diff --git a/CHANGELOG.md b/CHANGELOG.md index 310d8ac962..06a9575ee0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,9 @@ Increment the: * [CONFIGURATION] File configuration - implement log_level [#3810](https://github.com/open-telemetry/opentelemetry-cpp/pull/3810) +* [SEMANTIC CONVENTIONS] Upgrade to semantic conventions 1.39.0 + [#3813](https://github.com/open-telemetry/opentelemetry-cpp/pull/3813) + Breaking changes: * [CONFIGURATION] File configuration - remove zipkin diff --git a/api/include/opentelemetry/semconv/db_attributes.h b/api/include/opentelemetry/semconv/db_attributes.h index fa77366619..67abc8a669 100644 --- a/api/include/opentelemetry/semconv/db_attributes.h +++ b/api/include/opentelemetry/semconv/db_attributes.h @@ -84,7 +84,7 @@ static constexpr const char *kDbOperationName = "db.operation.name"; Summary may be available to the instrumentation through instrumentation hooks or other means. If it is not available, instrumentations that support query parsing SHOULD generate a summary following - Generating query + Generating query summary section. */ static constexpr const char *kDbQuerySummary = "db.query.summary"; @@ -92,11 +92,10 @@ static constexpr const char *kDbQuerySummary = "db.query.summary"; /** The database query being executed.
- For sanitization see Sanitization of @code - db.query.text @endcode. For batch operations, if the individual operations are known to have - the same query text then that query text SHOULD be used, otherwise all of the individual query - texts SHOULD be concatenated with separator @code ; @endcode or some other database system + For sanitization see Sanitization + of @code db.query.text @endcode. For batch operations, if the individual operations are known + to have the same query text then that query text SHOULD be used, otherwise all of the individual + query texts SHOULD be concatenated with separator @code ; @endcode or some other database system specific separator if more applicable. Parameterized query text SHOULD NOT be sanitized. Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter diff --git a/api/include/opentelemetry/semconv/error_attributes.h b/api/include/opentelemetry/semconv/error_attributes.h index e0ef3c925e..427a515347 100644 --- a/api/include/opentelemetry/semconv/error_attributes.h +++ b/api/include/opentelemetry/semconv/error_attributes.h @@ -35,7 +35,7 @@ namespace error additional filters are applied.
If the operation has completed successfully, instrumentations SHOULD NOT set @code error.type - @endcode.
If a specific domain defines its own set of error identifiers (such as HTTP or gRPC + @endcode.
If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes), it's RECOMMENDED to:
Docker defines a sha256 of the image id; @code container.image.id @endcode corresponds to the @code Image @endcode field from the Docker container inspect API + href="https://docs.docker.com/reference/api/engine/version/v1.52/#tag/Container/operation/ContainerInspect">API endpoint. K8s defines a link to the container registry repository with digest @code "imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625" @@ -92,7 +92,7 @@ static constexpr const char *kContainerImageName = "container.image.name"; Repo digests of the container image as provided by the container runtime.
Docker
+ href="https://docs.docker.com/reference/api/engine/version/v1.52/#tag/Image/operation/ImageInspect">Docker
and CRI
report those under the @code RepoDigests @endcode field.
@@ -101,7 +101,7 @@ static constexpr const char *kContainerImageRepoDigests = "container.image.repo_
/**
Container image tags. An example can be found in Docker
+ href="https://docs.docker.com/reference/api/engine/version/v1.52/#tag/Image/operation/ImageInspect">Docker
Image Inspect. Should be only the @code
- For sanitization see Sanitization of @code
- db.query.text @endcode. For batch operations, if the individual operations are known to have
- the same query text then that query text SHOULD be used, otherwise all of the individual query
- texts SHOULD be concatenated with separator @code ; @endcode or some other database system
+ For sanitization see Sanitization
+ of @code db.query.text @endcode. For batch operations, if the individual operations are known
+ to have the same query text then that query text SHOULD be used, otherwise all of the individual
+ query texts SHOULD be concatenated with separator @code ; @endcode or some other database system
specific separator if more applicable. Parameterized query text SHOULD NOT be sanitized. Even
though parameterized query text can potentially have sensitive data, by using a parameterized
query the user is giving a strong signal that any sensitive data will be passed as parameter
diff --git a/api/include/opentelemetry/semconv/incubating/error_attributes.h b/api/include/opentelemetry/semconv/incubating/error_attributes.h
index 439ae7bb11..2efa4b4876 100644
--- a/api/include/opentelemetry/semconv/incubating/error_attributes.h
+++ b/api/include/opentelemetry/semconv/incubating/error_attributes.h
@@ -47,7 +47,7 @@ static constexpr const char *kErrorMessage = "error.message";
additional filters are applied.
If the operation has completed successfully, instrumentations SHOULD NOT set @code error.type
- @endcode. If a specific domain defines its own set of error identifiers (such as HTTP or gRPC
+ @endcode. If a specific domain defines its own set of error identifiers (such as HTTP or RPC
status codes), it's RECOMMENDED to:
diff --git a/api/include/opentelemetry/semconv/incubating/jsonrpc_attributes.h b/api/include/opentelemetry/semconv/incubating/jsonrpc_attributes.h
new file mode 100644
index 0000000000..a89d6d3826
--- /dev/null
+++ b/api/include/opentelemetry/semconv/incubating/jsonrpc_attributes.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright The OpenTelemetry Authors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/*
+ * DO NOT EDIT, this is an Auto-generated file from:
+ * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2
+ */
+
+#pragma once
+
+#include "opentelemetry/common/macros.h"
+#include "opentelemetry/version.h"
+
+OPENTELEMETRY_BEGIN_NAMESPACE
+namespace semconv
+{
+namespace jsonrpc
+{
+
+/**
+ Protocol version, as specified in the @code jsonrpc @endcode property of the request and its
+ corresponding response.
+ */
+static constexpr const char *kJsonrpcProtocolVersion = "jsonrpc.protocol.version";
+
+/**
+ A string representation of the @code id @endcode property of the request and its corresponding
+ response. Under the JSON-RPC
+ specification, the @code id @endcode property may be a string, number, null, or omitted
+ entirely. When omitted, the request is treated as a notification. Using @code null @endcode is not
+ equivalent to omitting the @code id @endcode, but it is discouraged. Instrumentations SHOULD NOT
+ capture this attribute when the @code id @endcode is @code null @endcode or omitted.
+ */
+static constexpr const char *kJsonrpcRequestId = "jsonrpc.request.id";
+
+} // namespace jsonrpc
+} // namespace semconv
+OPENTELEMETRY_END_NAMESPACE
diff --git a/api/include/opentelemetry/semconv/incubating/k8s_attributes.h b/api/include/opentelemetry/semconv/incubating/k8s_attributes.h
index 8f18cfa4fe..b3361f3519 100644
--- a/api/include/opentelemetry/semconv/incubating/k8s_attributes.h
+++ b/api/include/opentelemetry/semconv/incubating/k8s_attributes.h
@@ -365,6 +365,29 @@ static constexpr const char *kK8sNodeUid = "k8s.node.uid";
*/
static constexpr const char *kK8sPodAnnotation = "k8s.pod.annotation";
+/**
+ Specifies the hostname of the Pod.
+
+ The K8s Pod spec has an optional hostname field, which can be used to specify a hostname.
+ Refer to K8s
+ docs for more information about this field. This attribute aligns with the @code hostname
+ @endcode field of the K8s
+ PodSpec.
+ */
+static constexpr const char *kK8sPodHostname = "k8s.pod.hostname";
+
+/**
+ IP address allocated to the Pod.
+
+ This attribute aligns with the @code podIP @endcode field of the
+ K8s
+ PodStatus.
+ */
+static constexpr const char *kK8sPodIp = "k8s.pod.ip";
+
/**
The label placed on the Pod, the @code Examples:
+ Date and time at which the object was acknowledged by the Kubelet.
+ This is before the Kubelet pulled the container image(s) for the pod.
+
+ This attribute aligns with the @code startTime @endcode field of the
+ K8s
+ PodStatus, in ISO 8601 (RFC 3339 compatible) format.
+ */
+static constexpr const char *kK8sPodStartTime = "k8s.pod.start_time";
+
/**
The phase for the pod. Corresponds to the @code phase @endcode field of the: K8s
diff --git a/api/include/opentelemetry/semconv/incubating/linux_attributes.h b/api/include/opentelemetry/semconv/incubating/linux_attributes.h
index 18e77516bc..c95497a78f 100644
--- a/api/include/opentelemetry/semconv/incubating/linux_attributes.h
+++ b/api/include/opentelemetry/semconv/incubating/linux_attributes.h
@@ -21,8 +21,13 @@ namespace linux
/**
The Linux Slab memory state
+
+ @deprecated
+ {"note": "Replaced by @code system.memory.linux.slab.state @endcode.", "reason": "renamed",
+ "renamed_to": "system.memory.linux.slab.state"}
*/
-static constexpr const char *kLinuxMemorySlabState = "linux.memory.slab.state";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kLinuxMemorySlabState =
+ "linux.memory.slab.state";
namespace LinuxMemorySlabStateValues
{
diff --git a/api/include/opentelemetry/semconv/incubating/mcp_attributes.h b/api/include/opentelemetry/semconv/incubating/mcp_attributes.h
new file mode 100644
index 0000000000..225444694b
--- /dev/null
+++ b/api/include/opentelemetry/semconv/incubating/mcp_attributes.h
@@ -0,0 +1,182 @@
+/*
+ * Copyright The OpenTelemetry Authors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/*
+ * DO NOT EDIT, this is an Auto-generated file from:
+ * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2
+ */
+
+#pragma once
+
+#include "opentelemetry/common/macros.h"
+#include "opentelemetry/version.h"
+
+OPENTELEMETRY_BEGIN_NAMESPACE
+namespace semconv
+{
+namespace mcp
+{
+
+/**
+ The name of the request or notification method.
+ */
+static constexpr const char *kMcpMethodName = "mcp.method.name";
+
+/**
+ The version of the Model
+ Context Protocol used.
+ */
+static constexpr const char *kMcpProtocolVersion = "mcp.protocol.version";
+
+/**
+ The value of the resource uri.
+
+ This is a URI of the resource provided in the following requests or notifications: @code
+ resources/read @endcode, @code resources/subscribe @endcode, @code resources/unsubscribe @endcode,
+ or @code notifications/resources/updated @endcode.
+ */
+static constexpr const char *kMcpResourceUri = "mcp.resource.uri";
+
+/**
+ Identifies MCP
+ session.
+ */
+static constexpr const char *kMcpSessionId = "mcp.session.id";
+
+namespace McpMethodNameValues
+{
+/**
+ Notification cancelling a previously-issued request.
+ */
+static constexpr const char *kNotificationsCancelled = "notifications/cancelled";
+
+/**
+ Request to initialize the MCP client.
+ */
+static constexpr const char *kInitialize = "initialize";
+
+/**
+ Notification indicating that the MCP client has been initialized.
+ */
+static constexpr const char *kNotificationsInitialized = "notifications/initialized";
+
+/**
+ Notification indicating the progress for a long-running operation.
+ */
+static constexpr const char *kNotificationsProgress = "notifications/progress";
+
+/**
+ Request to check that the other party is still alive.
+ */
+static constexpr const char *kPing = "ping";
+
+/**
+ Request to list resources available on server.
+ */
+static constexpr const char *kResourcesList = "resources/list";
+
+/**
+ Request to list resource templates available on server.
+ */
+static constexpr const char *kResourcesTemplatesList = "resources/templates/list";
+
+/**
+ Request to read a resource.
+ */
+static constexpr const char *kResourcesRead = "resources/read";
+
+/**
+ Notification indicating that the list of resources has changed.
+ */
+static constexpr const char *kNotificationsResourcesListChanged =
+ "notifications/resources/list_changed";
+
+/**
+ Request to subscribe to a resource.
+ */
+static constexpr const char *kResourcesSubscribe = "resources/subscribe";
+
+/**
+ Request to unsubscribe from resource updates.
+ */
+static constexpr const char *kResourcesUnsubscribe = "resources/unsubscribe";
+
+/**
+ Notification indicating that a resource has been updated.
+ */
+static constexpr const char *kNotificationsResourcesUpdated = "notifications/resources/updated";
+
+/**
+ Request to list prompts available on server.
+ */
+static constexpr const char *kPromptsList = "prompts/list";
+
+/**
+ Request to get a prompt.
+ */
+static constexpr const char *kPromptsGet = "prompts/get";
+
+/**
+ Notification indicating that the list of prompts has changed.
+ */
+static constexpr const char *kNotificationsPromptsListChanged =
+ "notifications/prompts/list_changed";
+
+/**
+ Request to list tools available on server.
+ */
+static constexpr const char *kToolsList = "tools/list";
+
+/**
+ Request to call a tool.
+ */
+static constexpr const char *kToolsCall = "tools/call";
+
+/**
+ Notification indicating that the list of tools has changed.
+ */
+static constexpr const char *kNotificationsToolsListChanged = "notifications/tools/list_changed";
+
+/**
+ Request to set the logging level.
+ */
+static constexpr const char *kLoggingSetLevel = "logging/setLevel";
+
+/**
+ Notification indicating that a message has been received.
+ */
+static constexpr const char *kNotificationsMessage = "notifications/message";
+
+/**
+ Request to create a sampling message.
+ */
+static constexpr const char *kSamplingCreateMessage = "sampling/createMessage";
+
+/**
+ Request to complete a prompt.
+ */
+static constexpr const char *kCompletionComplete = "completion/complete";
+
+/**
+ Request to list roots available on server.
+ */
+static constexpr const char *kRootsList = "roots/list";
+
+/**
+ Notification indicating that the list of roots has changed.
+ */
+static constexpr const char *kNotificationsRootsListChanged = "notifications/roots/list_changed";
+
+/**
+ Request from the server to elicit additional information from the user via the client
+ */
+static constexpr const char *kElicitationCreate = "elicitation/create";
+
+} // namespace McpMethodNameValues
+
+} // namespace mcp
+} // namespace semconv
+OPENTELEMETRY_END_NAMESPACE
diff --git a/api/include/opentelemetry/semconv/incubating/mcp_metrics.h b/api/include/opentelemetry/semconv/incubating/mcp_metrics.h
new file mode 100644
index 0000000000..39e95c2deb
--- /dev/null
+++ b/api/include/opentelemetry/semconv/incubating/mcp_metrics.h
@@ -0,0 +1,129 @@
+/*
+ * Copyright The OpenTelemetry Authors
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/*
+ * DO NOT EDIT, this is an Auto-generated file from:
+ * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2
+ */
+
+#pragma once
+
+#include "opentelemetry/common/macros.h"
+#include "opentelemetry/metrics/meter.h"
+#include "opentelemetry/version.h"
+
+OPENTELEMETRY_BEGIN_NAMESPACE
+namespace semconv
+{
+namespace mcp
+{
+
+/**
+ The duration of the MCP request or notification as observed on the sender from the time it was
+ sent until the response or ack is received. histogram
+ */
+static constexpr const char *kMetricMcpClientOperationDuration = "mcp.client.operation.duration";
+static constexpr const char *descrMetricMcpClientOperationDuration =
+ "The duration of the MCP request or notification as observed on the sender from the time it was sent until the response or ack is received.
+ ";
+ static constexpr const char *unitMetricMcpClientOperationDuration = "s";
+
+static inline nostd::unique_ptr
+ histogram
+ */
+static constexpr const char *kMetricMcpClientSessionDuration = "mcp.client.session.duration";
+static constexpr const char *descrMetricMcpClientSessionDuration =
+ "The duration of the MCP session as observed on the MCP client.";
+static constexpr const char *unitMetricMcpClientSessionDuration = "s";
+
+static inline nostd::unique_ptr histogram
+ */
+static constexpr const char *kMetricMcpServerOperationDuration = "mcp.server.operation.duration";
+static constexpr const char *descrMetricMcpServerOperationDuration =
+ "MCP request or notification duration as observed on the receiver from the time it was received until the result or ack is sent.
+ ";
+ static constexpr const char *unitMetricMcpServerOperationDuration = "s";
+
+static inline nostd::unique_ptr
+ histogram
+ */
+static constexpr const char *kMetricMcpServerSessionDuration = "mcp.server.session.duration";
+static constexpr const char *descrMetricMcpServerSessionDuration =
+ "The duration of the MCP session as observed on the MCP server.";
+static constexpr const char *unitMetricMcpServerSessionDuration = "s";
+
+static inline nostd::unique_ptr
+ This attribute SHOULD be used by non-OTLP exporters when destination does not support @code
+ EventName @endcode or equivalent field. This attribute MAY be used by applications using existing
+ logging libraries so that it can be used to set the @code EventName @endcode field by Collector or
+ SDK components.
+ */
+static constexpr const char *kOtelEventName = "otel.event.name";
+
/**
Deprecated. Use the @code otel.scope.name @endcode attribute
diff --git a/api/include/opentelemetry/semconv/incubating/peer_attributes.h b/api/include/opentelemetry/semconv/incubating/peer_attributes.h
index 290258ebed..0f061ff905 100644
--- a/api/include/opentelemetry/semconv/incubating/peer_attributes.h
+++ b/api/include/opentelemetry/semconv/incubating/peer_attributes.h
@@ -22,14 +22,18 @@ namespace peer
/**
The @code service.name @endcode of the remote
service. SHOULD be equal to the actual @code service.name @endcode resource attribute of the
- remote service if any. Examples of @code peer.service @endcode that users may specify: Examples of @code peer.service @endcode that users may specify:
+ The URL must be absolute and may be missing if the profile was generated by code that did not
+ supply a link
+ */
+static constexpr const char *kPprofProfileDocUrl = "pprof.profile.doc_url";
+
+/**
+ Frames with Function.function_name fully matching the regexp will be dropped from the samples,
+ along with their successors.
+ */
+static constexpr const char *kPprofProfileDropFrames = "pprof.profile.drop_frames";
+
+/**
+ Frames with Function.function_name fully matching the regexp will be kept, even if it matches
+ drop_frames.
+ */
+static constexpr const char *kPprofProfileKeepFrames = "pprof.profile.keep_frames";
+
} // namespace pprof
} // namespace semconv
OPENTELEMETRY_END_NAMESPACE
diff --git a/api/include/opentelemetry/semconv/incubating/process_metrics.h b/api/include/opentelemetry/semconv/incubating/process_metrics.h
index 0f1a783f76..83e16f4231 100644
--- a/api/include/opentelemetry/semconv/incubating/process_metrics.h
+++ b/api/include/opentelemetry/semconv/incubating/process_metrics.h
@@ -294,17 +294,20 @@ CreateAsyncDoubleMetricProcessNetworkIo(metrics::Meter *meter)
}
/**
- Number of file descriptors in use by the process.
-
- updowncounter
+ Deprecated, use @code process.unix.file_descriptor.count @endcode instead.
+
+ @deprecated
+ {"note": "Replaced by @code process.unix.file_descriptor.count @endcode.", "reason": "renamed",
+ "renamed_to": "process.unix.file_descriptor.count"} updowncounter
*/
-static constexpr const char *kMetricProcessOpenFileDescriptorCount =
+OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricProcessOpenFileDescriptorCount =
"process.open_file_descriptor.count";
-static constexpr const char *descrMetricProcessOpenFileDescriptorCount =
- "Number of file descriptors in use by the process.";
-static constexpr const char *unitMetricProcessOpenFileDescriptorCount = "{file_descriptor}";
+OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricProcessOpenFileDescriptorCount =
+ "Deprecated, use `process.unix.file_descriptor.count` instead.";
+OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricProcessOpenFileDescriptorCount =
+ "{file_descriptor}";
-static inline nostd::unique_ptr
+ updowncounter
+ */
+static constexpr const char *kMetricProcessUnixFileDescriptorCount =
+ "process.unix.file_descriptor.count";
+static constexpr const char *descrMetricProcessUnixFileDescriptorCount =
+ "Number of unix file descriptors in use by the process.";
+static constexpr const char *unitMetricProcessUnixFileDescriptorCount = "{file_descriptor}";
+
+static inline nostd::unique_ptr
@@ -453,6 +499,48 @@ static inline nostd::shared_ptr
+ updowncounter
+ */
+static constexpr const char *kMetricProcessWindowsHandleCount = "process.windows.handle.count";
+static constexpr const char *descrMetricProcessWindowsHandleCount =
+ "Number of handles held by the process.";
+static constexpr const char *unitMetricProcessWindowsHandleCount = "{handle}";
+
+static inline nostd::unique_ptr Instrumentations SHOULD require an explicit
- configuration of which metadata values are to be captured. Including all request metadata values
- can be a security risk - explicit configuration helps avoid leaking sensitive information. For
- example, a property @code my-custom-key @endcode with value @code ["1.2.3.4", "1.2.3.5"] @endcode
- SHOULD be recorded as the @code rpc.connect_rpc.request.metadata.my-custom-key @endcode attribute
- with value @code ["1.2.3.4", "1.2.3.5"] @endcode
+ Deprecated, use @code rpc.request.metadata @endcode instead.
+
+ @deprecated
+ {"note": "Replaced by @code rpc.request.metadata @endcode.", "reason": "renamed", "renamed_to":
+ "rpc.request.metadata"}
*/
-static constexpr const char *kRpcConnectRpcRequestMetadata = "rpc.connect_rpc.request.metadata";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kRpcConnectRpcRequestMetadata =
+ "rpc.connect_rpc.request.metadata";
/**
- Connect response metadata, @code Instrumentations SHOULD require an explicit
- configuration of which metadata values are to be captured. Including all response metadata values
- can be a security risk - explicit configuration helps avoid leaking sensitive information. For
- example, a property @code my-custom-key @endcode with value @code "attribute_value" @endcode
- SHOULD be recorded as the @code rpc.connect_rpc.response.metadata.my-custom-key @endcode attribute
- with value @code ["attribute_value"] @endcode
+ Deprecated, use @code rpc.response.metadata @endcode instead.
+
+ @deprecated
+ {"note": "Replaced by @code rpc.response.metadata @endcode.", "reason": "renamed", "renamed_to":
+ "rpc.response.metadata"}
*/
-static constexpr const char *kRpcConnectRpcResponseMetadata = "rpc.connect_rpc.response.metadata";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kRpcConnectRpcResponseMetadata =
+ "rpc.connect_rpc.response.metadata";
/**
- gRPC request metadata, @code Instrumentations SHOULD require an explicit configuration
- of which metadata values are to be captured. Including all request metadata values can be a
- security risk - explicit configuration helps avoid leaking sensitive information. For example,
- a property @code my-custom-key @endcode with value @code ["1.2.3.4", "1.2.3.5"] @endcode SHOULD be
- recorded as
- @code rpc.grpc.request.metadata.my-custom-key @endcode attribute with value @code ["1.2.3.4",
- "1.2.3.5"] @endcode
+ Deprecated, use @code rpc.request.metadata @endcode instead.
+
+ @deprecated
+ {"note": "Replaced by @code rpc.request.metadata @endcode.", "reason": "renamed", "renamed_to":
+ "rpc.request.metadata"}
*/
-static constexpr const char *kRpcGrpcRequestMetadata = "rpc.grpc.request.metadata";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kRpcGrpcRequestMetadata =
+ "rpc.grpc.request.metadata";
/**
- gRPC response metadata, @code Instrumentations SHOULD require an explicit configuration
- of which metadata values are to be captured. Including all response metadata values can be a
- security risk - explicit configuration helps avoid leaking sensitive information. For example,
- a property @code my-custom-key @endcode with value @code ["attribute_value"] @endcode SHOULD be
- recorded as the @code rpc.grpc.response.metadata.my-custom-key @endcode attribute with value @code
- ["attribute_value"] @endcode
+ Deprecated, use @code rpc.response.metadata @endcode instead.
+
+ @deprecated
+ {"note": "Replaced by @code rpc.response.metadata @endcode.", "reason": "renamed", "renamed_to":
+ "rpc.response.metadata"}
*/
-static constexpr const char *kRpcGrpcResponseMetadata = "rpc.grpc.response.metadata";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kRpcGrpcResponseMetadata =
+ "rpc.grpc.response.metadata";
/**
- The numeric status code
- of the gRPC request.
+ Deprecated, use string representation on the @code rpc.response.status_code @endcode attribute
+ instead.
+
+ @deprecated
+ {"note": "Use string representation of the gRPC status code on the @code rpc.response.status_code
+ @endcode attribute.", "reason": "uncategorized"}
*/
-static constexpr const char *kRpcGrpcStatusCode = "rpc.grpc.status_code";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kRpcGrpcStatusCode = "rpc.grpc.status_code";
/**
- @code error.code @endcode property of response if it is an error response.
+ Deprecated, use string representation on the @code rpc.response.status_code @endcode attribute
+ instead.
+
+ @deprecated
+ {"note": "Use string representation of the error code on the @code rpc.response.status_code
+ @endcode attribute.", "reason": "uncategorized"}
*/
-static constexpr const char *kRpcJsonrpcErrorCode = "rpc.jsonrpc.error_code";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kRpcJsonrpcErrorCode =
+ "rpc.jsonrpc.error_code";
/**
- @code error.message @endcode property of response if it is an error response.
+ Deprecated, use span status description or @code error.message @endcode attribute on other
+ signals.
+
+ @deprecated
+ {"note": "Use the span status description or @code error.message @endcode attribute on other
+ signals.", "reason": "uncategorized"}
*/
-static constexpr const char *kRpcJsonrpcErrorMessage = "rpc.jsonrpc.error_message";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kRpcJsonrpcErrorMessage =
+ "rpc.jsonrpc.error_message";
/**
- @code id @endcode property of request or response. Since protocol allows id to be int, string,
- @code null @endcode or missing (for notifications), value is expected to be cast to string for
- simplicity. Use empty string in case of @code null @endcode value. Omit entirely if this is a
- notification.
+ Deprecated, use @code jsonrpc.request.id @endcode instead.
+
+ @deprecated
+ {"note": "Replaced by @code jsonrpc.request.id @endcode.", "reason": "renamed", "renamed_to":
+ "jsonrpc.request.id"}
*/
-static constexpr const char *kRpcJsonrpcRequestId = "rpc.jsonrpc.request_id";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kRpcJsonrpcRequestId =
+ "rpc.jsonrpc.request_id";
/**
- Protocol version as in @code jsonrpc @endcode property of request/response. Since JSON-RPC 1.0
- doesn't specify this, the value can be omitted.
+ Deprecated, use @code jsonrpc.protocol.version @endcode instead.
+
+ @deprecated
+ {"note": "Replaced by @code jsonrpc.protocol.version @endcode.", "reason": "renamed",
+ "renamed_to": "jsonrpc.protocol.version"}
*/
-static constexpr const char *kRpcJsonrpcVersion = "rpc.jsonrpc.version";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kRpcJsonrpcVersion = "rpc.jsonrpc.version";
/**
Compressed size of the message in bytes.
@@ -123,19 +143,98 @@ static constexpr const char *kRpcMessageType = "rpc.message.type";
static constexpr const char *kRpcMessageUncompressedSize = "rpc.message.uncompressed_size";
/**
- This is the logical name of the method from the RPC interface perspective.
+ The fully-qualified logical name of the method from the RPC interface perspective.
+
+ The method name MAY have unbounded cardinality in edge or error cases.
+
+ Some RPC frameworks or libraries provide a fixed set of recognized methods
+ for client stubs and server implementations. Instrumentations for such
+ frameworks MUST set this attribute to the original method name only
+ when the method is recognized by the framework or library.
+
+ When the method is not recognized, for example, when the server receives
+ a request for a method that is not predefined on the server, or when
+ instrumentation is not able to reliably detect if the method is predefined,
+ the attribute MUST be set to @code _OTHER @endcode. In such cases, tracing
+ instrumentations MUST also set @code rpc.method_original @endcode attribute to
+ the original method value.
+
+ If the RPC instrumentation could end up converting valid RPC methods to
+ @code _OTHER @endcode, then it SHOULD provide a way to configure the list of recognized
+ RPC methods.
+
+ The @code rpc.method @endcode can be different from the name of any implementing
+ method/function.
+ The @code code.function.name @endcode attribute may be used to record the fully-qualified
+ method actually executing the call on the server side, or the
+ RPC client stub method on the client side.
*/
static constexpr const char *kRpcMethod = "rpc.method";
/**
- The full (logical) name of the service being called, including its package name, if applicable.
+ The original name of the method used by the client.
*/
-static constexpr const char *kRpcService = "rpc.service";
+static constexpr const char *kRpcMethodOriginal = "rpc.method_original";
/**
- A string identifying the remoting system. See below for a list of well-known identifiers.
+ RPC request metadata, @code Instrumentations SHOULD require an explicit configuration of
+ which metadata values are to be captured. Including all request metadata values can be a security
+ risk - explicit configuration helps avoid leaking sensitive information. For example, a
+ property @code my-custom-key @endcode with value @code ["1.2.3.4", "1.2.3.5"] @endcode SHOULD be
+ recorded as
+ @code rpc.request.metadata.my-custom-key @endcode attribute with value @code ["1.2.3.4",
+ "1.2.3.5"] @endcode
+ */
+static constexpr const char *kRpcRequestMetadata = "rpc.request.metadata";
+
+/**
+ RPC response metadata, @code Instrumentations SHOULD require an explicit configuration of
+ which metadata values are to be captured. Including all response metadata values can be a security
+ risk - explicit configuration helps avoid leaking sensitive information. For example, a
+ property @code my-custom-key @endcode with value @code ["attribute_value"] @endcode SHOULD be
+ recorded as the @code rpc.response.metadata.my-custom-key @endcode attribute with value @code
+ ["attribute_value"] @endcode
*/
-static constexpr const char *kRpcSystem = "rpc.system";
+static constexpr const char *kRpcResponseMetadata = "rpc.response.metadata";
+
+/**
+ Status code of the RPC returned by the RPC server or generated by the client
+
+ Usually it represents an error code, but may also represent partial success, warning, or
+ differentiate between various types of successful outcomes. Semantic conventions for individual
+ RPC frameworks SHOULD document what @code rpc.response.status_code @endcode means in the context
+ of that system and which values are considered to represent errors.
+ */
+static constexpr const char *kRpcResponseStatusCode = "rpc.response.status_code";
+
+/**
+ Deprecated, use fully-qualified @code rpc.method @endcode instead.
+
+ @deprecated
+ {"note": "Value should be included in @code rpc.method @endcode which is expected to be a
+ fully-qualified name.", "reason": "uncategorized"}
+ */
+OPENTELEMETRY_DEPRECATED static constexpr const char *kRpcService = "rpc.service";
+
+/**
+ Deprecated, use @code rpc.system.name @endcode attribute instead.
+
+ @deprecated
+ {"note": "Replaced by @code rpc.system.name @endcode.", "reason": "renamed", "renamed_to":
+ "rpc.system.name"}
+ */
+OPENTELEMETRY_DEPRECATED static constexpr const char *kRpcSystem = "rpc.system";
+
+/**
+ The Remote Procedure Call (RPC) system.
+
+ The client and server RPC systems may differ for the same RPC interaction. For example, a client
+ may use Apache Dubbo or Connect RPC to communicate with a server that uses gRPC since both
+ protocols provide compatibility with gRPC.
+ */
+static constexpr const char *kRpcSystemName = "rpc.system.name";
namespace RpcConnectRpcErrorCodeValues
{
@@ -311,6 +410,30 @@ static constexpr const char *kJsonrpc = "jsonrpc";
} // namespace RpcSystemValues
+namespace RpcSystemNameValues
+{
+/**
+ gRPC
+ */
+static constexpr const char *kGrpc = "grpc";
+
+/**
+ Apache Dubbo
+ */
+static constexpr const char *kDubbo = "dubbo";
+
+/**
+ Connect RPC
+ */
+static constexpr const char *kConnectrpc = "connectrpc";
+
+/**
+ JSON-RPC
+ */
+static constexpr const char *kJsonrpc = "jsonrpc";
+
+} // namespace RpcSystemNameValues
+
} // namespace rpc
} // namespace semconv
OPENTELEMETRY_END_NAMESPACE
diff --git a/api/include/opentelemetry/semconv/incubating/rpc_metrics.h b/api/include/opentelemetry/semconv/incubating/rpc_metrics.h
index 2933185e3e..755130a78b 100644
--- a/api/include/opentelemetry/semconv/incubating/rpc_metrics.h
+++ b/api/include/opentelemetry/semconv/incubating/rpc_metrics.h
@@ -21,29 +21,60 @@ namespace rpc
{
/**
- Measures the duration of outbound RPC.
+ Measures the duration of outbound remote procedure calls (RPC).
- While streaming RPCs may record this metric as start-of-batch
- to end-of-batch, it's hard to interpret in practice.
-
- Streaming: N/A.
+ When this metric is reported alongside an RPC client span, the metric value
+ SHOULD be the same as the RPC client span duration.
histogram
*/
-static constexpr const char *kMetricRpcClientDuration = "rpc.client.duration";
-static constexpr const char *descrMetricRpcClientDuration =
- "Measures the duration of outbound RPC.";
-static constexpr const char *unitMetricRpcClientDuration = "ms";
+static constexpr const char *kMetricRpcClientCallDuration = "rpc.client.call.duration";
+static constexpr const char *descrMetricRpcClientCallDuration =
+ "Measures the duration of outbound remote procedure calls (RPC).";
+static constexpr const char *unitMetricRpcClientCallDuration = "s";
static inline nostd::unique_ptr While streaming RPCs may record this metric as start-of-batch to
+ end-of-batch, it's hard to interpret in practice. Streaming: N/A.
+ histogram
+ */
+OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricRpcClientDuration =
+ "rpc.client.duration";
+OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricRpcClientDuration =
+ "Deprecated, use `rpc.client.call.duration` instead. Note: the unit also changed from `ms` to "
+ "`s`.";
+OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricRpcClientDuration = "ms";
+
+OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr
- While streaming RPCs may record this metric as start-of-batch
- to end-of-batch, it's hard to interpret in practice.
-
- Streaming: N/A.
+ When this metric is reported alongside an RPC server span, the metric value
+ SHOULD be the same as the RPC server span duration.
histogram
*/
-static constexpr const char *kMetricRpcServerDuration = "rpc.server.duration";
-static constexpr const char *descrMetricRpcServerDuration = "Measures the duration of inbound RPC.";
-static constexpr const char *unitMetricRpcServerDuration = "ms";
+static constexpr const char *kMetricRpcServerCallDuration = "rpc.server.call.duration";
+static constexpr const char *descrMetricRpcServerCallDuration =
+ "Measures the duration of inbound remote procedure calls (RPC).";
+static constexpr const char *unitMetricRpcServerCallDuration = "s";
static inline nostd::unique_ptr While streaming RPCs may record this metric as start-of-batch to
+ end-of-batch, it's hard to interpret in practice. Streaming: N/A.
+ histogram
+ */
+OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricRpcServerDuration =
+ "rpc.server.duration";
+OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricRpcServerDuration =
+ "Deprecated, use `rpc.server.call.duration` instead. Note: the unit also changed from `ms` to "
+ "`s`.";
+OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricRpcServerDuration = "ms";
+
+OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr This is an alternative to @code system.memory.usage @endcode metric with @code
- state=free @endcode. Linux starting from 3.14 exports "available" memory. It takes "free" memory
- as a baseline, and then factors in kernel-specific values. This is supposed to be more accurate
- than just "free" memory. For reference, see the calculations here. See also @code MemAvailable @endcode in /proc/meminfo. updowncounter
+ The number of packets transferred.
+
+ @deprecated
+ {"note": "Replaced by @code system.memory.linux.available @endcode.", "reason": "renamed",
+ "renamed_to": "system.memory.linux.available"} counter
*/
-static constexpr const char *kMetricSystemLinuxMemoryAvailable = "system.linux.memory.available";
-static constexpr const char *descrMetricSystemLinuxMemoryAvailable =
- "An estimate of how much memory is available for starting new applications, without causing "
- "swapping.";
-static constexpr const char *unitMetricSystemLinuxMemoryAvailable = "By";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricSystemLinuxMemoryAvailable =
+ "system.linux.memory.available";
+OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricSystemLinuxMemoryAvailable =
+ "The number of packets transferred.";
+OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricSystemLinuxMemoryAvailable =
+ "{packet}";
-static inline nostd::unique_ptr
- The sum over the @code reclaimable @endcode and @code unreclaimable @endcode state values in @code
- linux.memory.slab.usage @endcode SHOULD be equal to the total slab memory available on the system.
- Note that the total slab memory is not constant and may vary over time.
- See also the Slab
- allocator and @code Slab @endcode in /proc/meminfo. updowncounter
+ The number of packets transferred.
+
+ @deprecated
+ {"note": "Replaced by @code system.memory.linux.slab.usage @endcode.", "reason": "renamed",
+ "renamed_to": "system.memory.linux.slab.usage"} counter
*/
-static constexpr const char *kMetricSystemLinuxMemorySlabUsage = "system.linux.memory.slab.usage";
-static constexpr const char *descrMetricSystemLinuxMemorySlabUsage =
- "Reports the memory used by the Linux kernel for managing caches of frequently used objects.";
-static constexpr const char *unitMetricSystemLinuxMemorySlabUsage = "By";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricSystemLinuxMemorySlabUsage =
+ "system.linux.memory.slab.usage";
+OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricSystemLinuxMemorySlabUsage =
+ "The number of packets transferred.";
+OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricSystemLinuxMemorySlabUsage =
+ "{packet}";
-static inline nostd::unique_ptr This is an alternative to @code system.memory.usage @endcode metric with @code
+ state=free @endcode. Linux starting from 3.14 exports "available" memory. It takes "free" memory
+ as a baseline, and then factors in kernel-specific values. This is supposed to be more accurate
+ than just "free" memory. For reference, see the calculations here. See also @code MemAvailable @endcode in /proc/meminfo. updowncounter
+ */
+static constexpr const char *kMetricSystemMemoryLinuxAvailable = "system.memory.linux.available";
+static constexpr const char *descrMetricSystemMemoryLinuxAvailable =
+ "An estimate of how much memory is available for starting new applications, without causing "
+ "swapping.";
+static constexpr const char *unitMetricSystemMemoryLinuxAvailable = "By";
+
+static inline nostd::unique_ptr
+ The sum over the @code reclaimable @endcode and @code unreclaimable @endcode state values in @code
+ memory.linux.slab.usage @endcode SHOULD be equal to the total slab memory available on the system.
+ Note that the total slab memory is not constant and may vary over time.
+ See also the Slab
+ allocator and @code Slab @endcode in /proc/meminfo. updowncounter
+ */
+static constexpr const char *kMetricSystemMemoryLinuxSlabUsage = "system.memory.linux.slab.usage";
+static constexpr const char *descrMetricSystemMemoryLinuxSlabUsage =
+ "Reports the memory used by the Linux kernel for managing caches of frequently used objects.";
+static constexpr const char *unitMetricSystemMemoryLinuxSlabUsage = "By";
+
+static inline nostd::unique_ptr
diff --git a/api/include/opentelemetry/semconv/incubating/thread_attributes.h b/api/include/opentelemetry/semconv/incubating/thread_attributes.h
index 8aefe5667b..c6249884b6 100644
--- a/api/include/opentelemetry/semconv/incubating/thread_attributes.h
+++ b/api/include/opentelemetry/semconv/incubating/thread_attributes.h
@@ -24,7 +24,7 @@ namespace thread
Examples of where the value can be extracted from:
- | Language or platform | Source |
+ | Language or platform | Source |
| --- | --- |
| JVM | @code Thread.currentThread().threadId() @endcode |
| .NET | @code Thread.CurrentThread.ManagedThreadId @endcode |
@@ -40,7 +40,7 @@ static constexpr const char *kThreadId = "thread.id";
Examples of where the value can be extracted from:
- | Language or platform | Source |
+ | Language or platform | Source |
| --- | --- |
| JVM | @code Thread.currentThread().getName() @endcode |
| .NET | @code Thread.CurrentThread.Name @endcode |
diff --git a/api/include/opentelemetry/semconv/incubating/user_agent_attributes.h b/api/include/opentelemetry/semconv/incubating/user_agent_attributes.h
index f3c59a691e..6b54c3061c 100644
--- a/api/include/opentelemetry/semconv/incubating/user_agent_attributes.h
+++ b/api/include/opentelemetry/semconv/incubating/user_agent_attributes.h
@@ -22,7 +22,7 @@ namespace user_agent
/**
Name of the user-agent extracted from original. Usually refers to the browser's name.
- Example of extracting browser's name from original
+ Example of extracting browser's name from original
string. In the case of using a user-agent for non-browser products, such as microservices with
multiple names/versions inside the @code user_agent.original @endcode, the most significant name
SHOULD be selected. In such a scenario it should align with @code user_agent.version @endcode
@@ -66,7 +66,7 @@ static constexpr const char *kUserAgentSyntheticType = "user_agent.synthetic.typ
/**
Version of the user-agent extracted from original. Usually refers to the browser's version
- Example of extracting browser's version from original
+ Example of extracting browser's version from original
string. In the case of using a user-agent for non-browser products, such as microservices with
multiple names/versions inside the @code user_agent.original @endcode, the most significant
version SHOULD be selected. In such a scenario it should align with @code user_agent.name @endcode
diff --git a/api/include/opentelemetry/semconv/schema_url.h b/api/include/opentelemetry/semconv/schema_url.h
index 50beae469f..5acdd1dd7b 100644
--- a/api/include/opentelemetry/semconv/schema_url.h
+++ b/api/include/opentelemetry/semconv/schema_url.h
@@ -19,6 +19,6 @@ namespace semconv
/**
* The URL of the OpenTelemetry schema for these keys and values.
*/
-static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.38.0";
+static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.39.0";
} // namespace semconv
OPENTELEMETRY_END_NAMESPACE
diff --git a/api/include/opentelemetry/semconv/service_attributes.h b/api/include/opentelemetry/semconv/service_attributes.h
index 1f335ca26e..d0a5f33c79 100644
--- a/api/include/opentelemetry/semconv/service_attributes.h
+++ b/api/include/opentelemetry/semconv/service_attributes.h
@@ -31,8 +31,7 @@ namespace service
static constexpr const char *kServiceName = "service.name";
/**
- The version string of the service API or implementation. The format is not defined by these
- conventions.
+ The version string of the service component. The format is not defined by these conventions.
*/
static constexpr const char *kServiceVersion = "service.version";
diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh
index 6e4499a0f6..a80b9daa70 100755
--- a/buildscripts/semantic-convention/generate.sh
+++ b/buildscripts/semantic-convention/generate.sh
@@ -16,10 +16,10 @@ ROOT_DIR="${SCRIPT_DIR}/../../"
# freeze the spec & generator tools versions to make the generation reproducible
# repository: https://github.com/open-telemetry/semantic-conventions
-SEMCONV_VERSION=1.38.0
+SEMCONV_VERSION=1.39.0
# repository: https://github.com/open-telemetry/weaver
-WEAVER_VERSION=0.18.0
+WEAVER_VERSION=0.20.0
SEMCONV_VERSION_TAG=v$SEMCONV_VERSION
WEAVER_VERSION_TAG=v$WEAVER_VERSION
+ remote service if any.
+
+ @deprecated
+ {"note": "Replaced by @code service.peer.name @endcode.", "reason": "renamed", "renamed_to":
+ "service.peer.name"}
*/
-static constexpr const char *kPeerService = "peer.service";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kPeerService = "peer.service";
} // namespace peer
} // namespace semconv
diff --git a/api/include/opentelemetry/semconv/incubating/pprof_attributes.h b/api/include/opentelemetry/semconv/incubating/pprof_attributes.h
index dc55f9c7e1..23c0370308 100644
--- a/api/include/opentelemetry/semconv/incubating/pprof_attributes.h
+++ b/api/include/opentelemetry/semconv/incubating/pprof_attributes.h
@@ -53,6 +53,26 @@ static constexpr const char *kPprofMappingHasLineNumbers = "pprof.mapping.has_li
*/
static constexpr const char *kPprofProfileComment = "pprof.profile.comment";
+/**
+ Documentation link for this profile type.
+