diff --git a/CHANGELOG.md b/CHANGELOG.md index 07005073f4..bfe4603421 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,9 @@ Increment the: * [BUILD] Avoid break caused by max() macro on windows [#3863](https://github.com/open-telemetry/opentelemetry-cpp/pull/3863) +* [SEMANTIC CONVENTIONS] Upgrade to semantic conventions 1.40.0 + [#3881](https://github.com/open-telemetry/opentelemetry-cpp/pull/3881) + ## [1.25 2026-02-07] * [RELEASE] Bump main branch to 1.25.0-dev (#3759) diff --git a/api/include/opentelemetry/semconv/db_attributes.h b/api/include/opentelemetry/semconv/db_attributes.h index 67abc8a669..f9fc8ed8ff 100644 --- a/api/include/opentelemetry/semconv/db_attributes.h +++ b/api/include/opentelemetry/semconv/db_attributes.h @@ -85,7 +85,10 @@ static constexpr const char *kDbOperationName = "db.operation.name"; instrumentation hooks or other means. If it is not available, instrumentations that support query parsing SHOULD generate a summary following Generating query - summary section. + summary section.
For batch operations, if the individual operations are known to have the + same query summary then that query summary SHOULD be used prepended by @code BATCH @endcode, + otherwise @code db.query.summary @endcode SHOULD be @code BATCH @endcode or some other database + system specific term if more applicable. */ static constexpr const char *kDbQuerySummary = "db.query.summary"; diff --git a/api/include/opentelemetry/semconv/exception_attributes.h b/api/include/opentelemetry/semconv/exception_attributes.h index 8947d711f1..15b5cde060 100644 --- a/api/include/opentelemetry/semconv/exception_attributes.h +++ b/api/include/opentelemetry/semconv/exception_attributes.h @@ -30,6 +30,10 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kExceptionEscaped = "excep /** The exception message. +
+ [!WARNING] +*/ static constexpr const char *kExceptionMessage = "exception.message"; diff --git a/api/include/opentelemetry/semconv/http_attributes.h b/api/include/opentelemetry/semconv/http_attributes.h index b815b5d6b8..6f7bbd3f9d 100644 --- a/api/include/opentelemetry/semconv/http_attributes.h +++ b/api/include/opentelemetry/semconv/http_attributes.h @@ -53,13 +53,21 @@ static constexpr const char *kHttpRequestHeader = "http.request.header"; could end up converting valid HTTP request methods to @code _OTHER @endcode, then it MUST provide a way to override the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and - support a comma-separated list of case-sensitive known HTTP methods (this list MUST be a full - override of the default known method, it is not a list of known methods in addition to the - defaults).+ This attribute may contain sensitive information.
HTTP method names are case-sensitive and @code http.request.method @endcode - attribute value MUST match a known HTTP method name exactly. Instrumentations for specific web - frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical - equivalent. Tracing instrumentations that do so, MUST also set @code http.request.method_original - @endcode to the original value. + support a comma-separated list of case-sensitive known HTTP methods.
+ + If this override is done via declarative configuration, then the list MUST be configurable via the + @code known_methods @endcode property (an array of case-sensitive strings with minimum items 0) + under @code .instrumentation/development.general.http.client @endcode and/or + @code .instrumentation/development.general.http.server @endcode. +
+ In either case, this list MUST be a full override of the default known methods, + it is not a list of known methods in addition to the defaults. +
+ HTTP method names are case-sensitive and @code http.request.method @endcode attribute value MUST + match a known HTTP method name exactly. Instrumentations for specific web frameworks that consider + HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. Tracing + instrumentations that do so, MUST also set @code http.request.method_original @endcode to the + original value. */ static constexpr const char *kHttpRequestMethod = "http.request.method"; diff --git a/api/include/opentelemetry/semconv/incubating/db_attributes.h b/api/include/opentelemetry/semconv/incubating/db_attributes.h index 0384eab4cd..8be4d501e9 100644 --- a/api/include/opentelemetry/semconv/incubating/db_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/db_attributes.h @@ -417,7 +417,10 @@ static constexpr const char *kDbQueryParameter = "db.query.parameter"; instrumentation hooks or other means. If it is not available, instrumentations that support query parsing SHOULD generate a summary following Generating query - summary section. + summary section.
For batch operations, if the individual operations are known to have the + same query summary then that query summary SHOULD be used prepended by @code BATCH @endcode, + otherwise @code db.query.summary @endcode SHOULD be @code BATCH @endcode or some other database + system specific term if more applicable. */ static constexpr const char *kDbQuerySummary = "db.query.summary"; diff --git a/api/include/opentelemetry/semconv/incubating/error_attributes.h b/api/include/opentelemetry/semconv/incubating/error_attributes.h index 2efa4b4876..ff42fadcbf 100644 --- a/api/include/opentelemetry/semconv/incubating/error_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/error_attributes.h @@ -21,7 +21,10 @@ namespace error /** A message providing more detail about an error in human-readable form. -
+ + @deprecated + {"note": "Use domain-specific error message attribute. For example, use @code + feature_flag.error.message @endcode for feature flag errors.", "reason": "obsoleted"}
@code error.message @endcode should provide additional context and detail about an error. It is NOT RECOMMENDED to duplicate the value of @code error.type @endcode in @code error.message @endcode. It is also NOT RECOMMENDED to duplicate the value of @code exception.message @endcode in @@ -29,7 +32,7 @@ namespace error @code error.message @endcode is NOT RECOMMENDED for metrics or spans due to its unbounded cardinality and overlap with span status. */ -static constexpr const char *kErrorMessage = "error.message"; +OPENTELEMETRY_DEPRECATED static constexpr const char *kErrorMessage = "error.message"; /** Describes a class of error the operation ended with. diff --git a/api/include/opentelemetry/semconv/incubating/exception_attributes.h b/api/include/opentelemetry/semconv/incubating/exception_attributes.h index 8947d711f1..15b5cde060 100644 --- a/api/include/opentelemetry/semconv/incubating/exception_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/exception_attributes.h @@ -30,6 +30,10 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kExceptionEscaped = "excep /** The exception message. +
+ [!WARNING] +*/ static constexpr const char *kExceptionMessage = "exception.message"; diff --git a/api/include/opentelemetry/semconv/incubating/feature_flag_attributes.h b/api/include/opentelemetry/semconv/incubating/feature_flag_attributes.h index f80c0ad4cb..767f1e54c1 100644 --- a/api/include/opentelemetry/semconv/incubating/feature_flag_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/feature_flag_attributes.h @@ -25,11 +25,17 @@ namespace feature_flag static constexpr const char *kFeatureFlagContextId = "feature_flag.context.id"; /** - Deprecated, use @code error.message @endcode instead. + A message providing more detail about an error that occurred during feature flag evaluation in + human-readable form. + */ +static constexpr const char *kFeatureFlagErrorMessage = "feature_flag.error.message"; + +/** + Deprecated, use @code feature_flag.error.message @endcode instead. @deprecated - {"note": "Replaced by @code error.message @endcode.", "reason": "renamed", "renamed_to": - "error.message"} + {"note": "Replaced by @code feature_flag.error.message @endcode.", "reason": "renamed", + "renamed_to": "feature_flag.error.message"} */ OPENTELEMETRY_DEPRECATED static constexpr const char *kFeatureFlagEvaluationErrorMessage = "feature_flag.evaluation.error.message"; diff --git a/api/include/opentelemetry/semconv/incubating/gcp_attributes.h b/api/include/opentelemetry/semconv/incubating/gcp_attributes.h index 74ddef337d..f0d92164b4 100644 --- a/api/include/opentelemetry/semconv/incubating/gcp_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/gcp_attributes.h @@ -180,6 +180,26 @@ static constexpr const char *kGcpGceInstanceHostname = "gcp.gce.instance.hostnam */ static constexpr const char *kGcpGceInstanceName = "gcp.gce.instance.name"; +/** + The name of the Instance Group Manager (IGM) that manages this VM, if any. + */ +static constexpr const char *kGcpGceInstanceGroupManagerName = + "gcp.gce.instance_group_manager.name"; + +/** + The region of a regional Instance Group Manager (e.g., @code us-central1 + @endcode). Set this only when the IGM is regional. + */ +static constexpr const char *kGcpGceInstanceGroupManagerRegion = + "gcp.gce.instance_group_manager.region"; + +/** + The zone of a zonal Instance Group Manager (e.g., @code us-central1-a @endcode). + Set this only when the IGM is zonal. + */ +static constexpr const char *kGcpGceInstanceGroupManagerZone = + "gcp.gce.instance_group_manager.zone"; + namespace GcpApphubServiceCriticalityTypeValues { /** diff --git a/api/include/opentelemetry/semconv/incubating/gen_ai_attributes.h b/api/include/opentelemetry/semconv/incubating/gen_ai_attributes.h index d7407c4143..1ff125dddb 100644 --- a/api/include/opentelemetry/semconv/incubating/gen_ai_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/gen_ai_attributes.h @@ -34,6 +34,11 @@ static constexpr const char *kGenAiAgentId = "gen_ai.agent.id"; */ static constexpr const char *kGenAiAgentName = "gen_ai.agent.name"; +/** + The version of the GenAI agent. + */ +static constexpr const char *kGenAiAgentVersion = "gen_ai.agent.version"; + /** Deprecated, use Event API to report completions contents. @@ -311,6 +316,27 @@ static constexpr const char *kGenAiResponseId = "gen_ai.response.id"; */ static constexpr const char *kGenAiResponseModel = "gen_ai.response.model"; +/** + The documents retrieved. ++ This attribute may contain sensitive information.
+ Instrumentations MUST follow Retrieval + documents JSON schema. When the attribute is recorded on events, it MUST be recorded in + structured form. When recorded on spans, it MAY be recorded as a JSON string if structured format + is not supported and SHOULD be recorded in structured form otherwise.
Each document object + SHOULD contain at least the following properties: + @code id @endcode (string): A unique identifier for the document, @code score @endcode (double): + The relevance score of the document + */ +static constexpr const char *kGenAiRetrievalDocuments = "gen_ai.retrieval.documents"; + +/** + The query text used for retrieval. +
+ [!Warning] + This attribute may contain sensitive information.+ */ +static constexpr const char *kGenAiRetrievalQueryText = "gen_ai.retrieval.query.text"; + /** Deprecated, use @code gen_ai.provider.name @endcode instead. @@ -418,6 +444,22 @@ static constexpr const char *kGenAiToolName = "gen_ai.tool.name"; */ static constexpr const char *kGenAiToolType = "gen_ai.tool.type"; +/** + The number of input tokens written to a provider-managed cache. +
+ The value SHOULD be included in @code gen_ai.usage.input_tokens @endcode. + */ +static constexpr const char *kGenAiUsageCacheCreationInputTokens = + "gen_ai.usage.cache_creation.input_tokens"; + +/** + The number of input tokens served from a provider-managed cache. +
+ The value SHOULD be included in @code gen_ai.usage.input_tokens @endcode. + */ +static constexpr const char *kGenAiUsageCacheReadInputTokens = + "gen_ai.usage.cache_read.input_tokens"; + /** Deprecated, use @code gen_ai.usage.output_tokens @endcode instead. @@ -430,6 +472,11 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kGenAiUsageCompletionToken /** The number of tokens used in the GenAI input (prompt). +
+ This value SHOULD include all types of input tokens, including cached tokens. + Instrumentations SHOULD make a best effort to populate this value, using a total + provided by the provider when available or, depending on the provider API, + by summing different token types parsed from the provider output. */ static constexpr const char *kGenAiUsageInputTokens = "gen_ai.usage.input_tokens"; @@ -509,6 +556,13 @@ static constexpr const char *kTextCompletion = "text_completion"; */ static constexpr const char *kEmbeddings = "embeddings"; +/** + Retrieval operation such as OpenAI Search Vector + Store API + */ +static constexpr const char *kRetrieval = "retrieval"; + /** Create GenAI agent */ diff --git a/api/include/opentelemetry/semconv/incubating/http_attributes.h b/api/include/opentelemetry/semconv/incubating/http_attributes.h index 1af52bbb62..acdb1a8927 100644 --- a/api/include/opentelemetry/semconv/incubating/http_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/http_attributes.h @@ -104,13 +104,21 @@ static constexpr const char *kHttpRequestHeader = "http.request.header"; could end up converting valid HTTP request methods to @code _OTHER @endcode, then it MUST provide a way to override the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and - support a comma-separated list of case-sensitive known HTTP methods (this list MUST be a full - override of the default known method, it is not a list of known methods in addition to the - defaults).
HTTP method names are case-sensitive and @code http.request.method @endcode - attribute value MUST match a known HTTP method name exactly. Instrumentations for specific web - frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical - equivalent. Tracing instrumentations that do so, MUST also set @code http.request.method_original - @endcode to the original value. + support a comma-separated list of case-sensitive known HTTP methods.
+ + If this override is done via declarative configuration, then the list MUST be configurable via the + @code known_methods @endcode property (an array of case-sensitive strings with minimum items 0) + under @code .instrumentation/development.general.http.client @endcode and/or + @code .instrumentation/development.general.http.server @endcode. +
+ In either case, this list MUST be a full override of the default known methods, + it is not a list of known methods in addition to the defaults. +
+ HTTP method names are case-sensitive and @code http.request.method @endcode attribute value MUST
+ match a known HTTP method name exactly. Instrumentations for specific web frameworks that consider
+ HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. Tracing
+ instrumentations that do so, MUST also set @code http.request.method_original @endcode to the
+ original value.
*/
static constexpr const char *kHttpRequestMethod = "http.request.method";
diff --git a/api/include/opentelemetry/semconv/incubating/k8s_attributes.h b/api/include/opentelemetry/semconv/incubating/k8s_attributes.h
index b3361f3519..208b47d3c6 100644
--- a/api/include/opentelemetry/semconv/incubating/k8s_attributes.h
+++ b/api/include/opentelemetry/semconv/incubating/k8s_attributes.h
@@ -510,6 +510,126 @@ static constexpr const char *kK8sResourcequotaResourceName = "k8s.resourcequota.
*/
static constexpr const char *kK8sResourcequotaUid = "k8s.resourcequota.uid";
+/**
+ The annotation placed on the Service, the @code Examples:
+ The network address family or type of the endpoint.
+ This attribute aligns with the @code addressType @endcode field of the
+ K8s
+ EndpointSlice. It is used to differentiate metrics when a Service is backed by multiple
+ address types (e.g., in dual-stack clusters).
+ */
+static constexpr const char *kK8sServiceEndpointAddressType = "k8s.service.endpoint.address_type";
+
+/**
+ The condition of the service endpoint.
+
+ The current operational condition of the service endpoint.
+ An endpoint can have multiple conditions set at once (e.g., both @code serving @endcode and @code
+ terminating @endcode during rollout). This attribute aligns with the condition fields in the K8s
+ EndpointSlice.
+ */
+static constexpr const char *kK8sServiceEndpointCondition = "k8s.service.endpoint.condition";
+
+/**
+ The zone of the service endpoint.
+
+ The zone where the endpoint is located, typically corresponding to a failure domain.
+ This attribute aligns with the @code zone @endcode field of endpoints in the
+ K8s
+ EndpointSlice. It enables zone-aware monitoring of service endpoint distribution and supports
+ features like Topology
+ Aware Routing. If the zone is not populated (e.g., nodes without the @code
+ topology.kubernetes.io/zone @endcode label), the attribute value will be an empty string.
+ */
+static constexpr const char *kK8sServiceEndpointZone = "k8s.service.endpoint.zone";
+
+/**
+ The label placed on the Service, the @code Examples:
+ Whether the Service is configured to publish endpoints before the pods are ready.
+ This attribute is typically used to indicate that a Service (such as a headless
+ Service for a StatefulSet) allows peer discovery before pods pass their readiness probes.
+ It aligns with the @code publishNotReadyAddresses @endcode field of the
+ K8s
+ ServiceSpec.
+ */
+static constexpr const char *kK8sServicePublishNotReadyAddresses =
+ "k8s.service.publish_not_ready_addresses";
+
+/**
+ The selector key-value pair placed on the Service, the @code These selectors are used to correlate with pod
+ labels. Each selector key-value pair becomes a separate attribute. Examples:
+ Specifies how traffic is distributed to endpoints for this Service.
+ This attribute aligns with the @code trafficDistribution @endcode field of the
+ K8s
+ ServiceSpec. Known values include @code PreferSameZone @endcode (prefer endpoints in the same
+ zone as the client) and
+ @code PreferSameNode @endcode (prefer endpoints on the same node, fallback to same zone, then
+ cluster-wide). If this field is not set on the Service, the attribute SHOULD NOT be emitted. When
+ not set, Kubernetes distributes traffic evenly across all endpoints cluster-wide.
+ */
+static constexpr const char *kK8sServiceTrafficDistribution = "k8s.service.traffic_distribution";
+
+/**
+ The type of the Kubernetes Service.
+
+ This attribute aligns with the @code type @endcode field of the
+ K8s
+ ServiceSpec.
+ */
+static constexpr const char *kK8sServiceType = "k8s.service.type";
+
+/**
+ The UID of the Service.
+ */
+static constexpr const char *kK8sServiceUid = "k8s.service.uid";
+
/**
The annotation placed on the StatefulSet, the @code Examples:
+ This metric is derived from the Kubernetes EndpointSlice
+ API. It reports the number of network endpoints backing a Service, broken down by their
+ condition and address type. In dual-stack or multi-protocol clusters, separate counts are
+ reported for each address family (@code IPv4 @endcode, @code IPv6 @endcode, @code FQDN @endcode).
+
+ When the optional @code zone @endcode attribute is enabled, counts are further broken down by
+ availability zone for zone-aware monitoring. An endpoint may be reported under multiple
+ conditions simultaneously (e.g., both @code serving @endcode and @code terminating @endcode during
+ a graceful shutdown). See K8s
+ EndpointConditions for more details. The conditions represent:
+ For Services with @code publishNotReadyAddresses @endcode enabled (common for headless
+ StatefulSets), this metric will include endpoints that are published despite not being ready. The
+ @code k8s.service.publish_not_ready_addresses @endcode resource attribute indicates this setting.
+
+ gauge
+ */
+static constexpr const char *kMetricK8sServiceEndpointCount = "k8s.service.endpoint.count";
+static constexpr const char *descrMetricK8sServiceEndpointCount =
+ "Number of endpoints for a service by condition and address type.";
+static constexpr const char *unitMetricK8sServiceEndpointCount = "{endpoint}";
+
+#if OPENTELEMETRY_ABI_VERSION_NO >= 2
+
+static inline nostd::unique_ptr
+ This metric reports the number of external ingress points (IP addresses or hostnames)
+ assigned to a LoadBalancer Service.
+
+ It is only emitted for Services of type @code LoadBalancer @endcode and reflects the assignments
+ made by the underlying infrastructure's load balancer controller in the
+ .status.loadBalancer.ingress
+ field. A value of @code 0 @endcode indicates that no ingress points have been assigned yet
+ (e.g., during provisioning). A value greater than @code 1 @endcode may occur when multiple IPs or
+ hostnames are assigned (e.g., dual-stack configurations). This metric signals that external
+ endpoints have been assigned by the load balancer controller, but it does not guarantee that the
+ load balancer is healthy. gauge
+ */
+static constexpr const char *kMetricK8sServiceLoadBalancerIngressCount =
+ "k8s.service.load_balancer.ingress.count";
+static constexpr const char *descrMetricK8sServiceLoadBalancerIngressCount =
+ "Number of load balancer ingress points (external IPs/hostnames) assigned to the service.";
+static constexpr const char *unitMetricK8sServiceLoadBalancerIngressCount = "{ingress}";
+
+#if OPENTELEMETRY_ABI_VERSION_NO >= 2
+
+static inline nostd::unique_ptr
+ This attribute SHOULD be set to the value of the @code DB_DOMAIN @endcode initialization
+ parameter, as exposed in @code v$parameter @endcode. @code DB_DOMAIN @endcode defines the domain
+ portion of the global database name and SHOULD be configured when a database is, or may become,
+ part of a distributed environment. Its value consists of one or more valid identifiers
+ (alphanumeric ASCII characters) separated by periods.
+ */
+static constexpr const char *kOracleDbDomain = "oracle.db.domain";
+
+/**
+ The instance name associated with the connection in an Oracle Real Application Clusters
+ environment. There can be multiple instances associated with a single database service. It
+ indicates the unique instance name to which the connection is currently bound. For non-RAC
+ databases, this value defaults to the @code oracle.db.name @endcode.
+ */
+static constexpr const char *kOracleDbInstanceName = "oracle.db.instance.name";
+
+/**
+ The database name associated with the connection.
+
+ This attribute SHOULD be set to the value of the parameter @code DB_NAME @endcode exposed in @code
+ v$parameter @endcode.
+ */
+static constexpr const char *kOracleDbName = "oracle.db.name";
+
+/**
+ The pluggable database (PDB) name associated with the connection.
+
+ This attribute SHOULD reflect the PDB that the session is currently connected to.
+ If instrumentation cannot reliably obtain the active PDB name for each operation
+ without issuing an additional query (such as @code SELECT SYS_CONTEXT @endcode), it is
+ RECOMMENDED to fall back to the PDB name specified at connection establishment.
+ */
+static constexpr const char *kOracleDbPdb = "oracle.db.pdb";
+
+/**
+ The service name currently associated with the database connection.
+
+ The effective service name for a connection can change during its lifetime,
+ for example after executing sql, @code ALTER SESSION @endcode. If an instrumentation cannot
+ reliably obtain the current service name for each operation without issuing an additional query
+ (such as @code SELECT SYS_CONTEXT @endcode), it is RECOMMENDED to fall back to the service name
+ originally provided at connection establishment.
+ */
+static constexpr const char *kOracleDbService = "oracle.db.service";
+
+} // namespace oracle
+} // namespace semconv
+OPENTELEMETRY_END_NAMESPACE
diff --git a/api/include/opentelemetry/semconv/incubating/oracle_cloud_attributes.h b/api/include/opentelemetry/semconv/incubating/oracle_cloud_attributes.h
new file mode 100644
index 0000000000..80902c78a0
--- /dev/null
+++ b/api/include/opentelemetry/semconv/incubating/oracle_cloud_attributes.h
@@ -0,0 +1,32 @@
+/*
+ * 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 oracle_cloud
+{
+
+/**
+ The OCI realm identifier that indicates the isolated partition in which the tenancy and its
+ resources reside. See OCI documentation on
+ realms
+ */
+static constexpr const char *kOracleCloudRealm = "oracle_cloud.realm";
+
+} // namespace oracle_cloud
+} // namespace semconv
+OPENTELEMETRY_END_NAMESPACE
diff --git a/api/include/opentelemetry/semconv/incubating/pprof_attributes.h b/api/include/opentelemetry/semconv/incubating/pprof_attributes.h
index 23c0370308..a0f58af3d3 100644
--- a/api/include/opentelemetry/semconv/incubating/pprof_attributes.h
+++ b/api/include/opentelemetry/semconv/incubating/pprof_attributes.h
@@ -73,6 +73,21 @@ static constexpr const char *kPprofProfileDropFrames = "pprof.profile.drop_frame
*/
static constexpr const char *kPprofProfileKeepFrames = "pprof.profile.keep_frames";
+/**
+ Records the pprof's default_sample_type in the original profile. Not set if the default sample
+ type was missing. This attribute, if present, MUST be set at the scope level
+ (resource_profiles[].scope_profiles[].scope.attributes[]).
+ */
+static constexpr const char *kPprofScopeDefaultSampleType = "pprof.scope.default_sample_type";
+
+/**
+ Records the indexes of the sample types in the original profile.
+
+ This attribute, if present, MUST be set at the scope level
+ (resource_profiles[].scope_profiles[].scope.attributes[]).
+ */
+static constexpr const char *kPprofScopeSampleTypeOrder = "pprof.scope.sample_type_order";
+
} // namespace pprof
} // namespace semconv
OPENTELEMETRY_END_NAMESPACE
diff --git a/api/include/opentelemetry/semconv/incubating/rpc_attributes.h b/api/include/opentelemetry/semconv/incubating/rpc_attributes.h
index 7c016bf898..6b644e57ee 100644
--- a/api/include/opentelemetry/semconv/incubating/rpc_attributes.h
+++ b/api/include/opentelemetry/semconv/incubating/rpc_attributes.h
@@ -91,12 +91,11 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kRpcJsonrpcErrorCode =
"rpc.jsonrpc.error_code";
/**
- Deprecated, use span status description or @code error.message @endcode attribute on other
- signals.
+ Deprecated, use the span status description when reporting JSON-RPC spans.
@deprecated
- {"note": "Use the span status description or @code error.message @endcode attribute on other
- signals.", "reason": "uncategorized"}
+ {"note": "Use the span status description when reporting JSON-RPC spans.", "reason":
+ "uncategorized"}
*/
OPENTELEMETRY_DEPRECATED static constexpr const char *kRpcJsonrpcErrorMessage =
"rpc.jsonrpc.error_message";
@@ -122,25 +121,40 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kRpcJsonrpcVersion = "rpc.
/**
Compressed size of the message in bytes.
+
+ @deprecated
+ {"note": "Deprecated, no replacement at this time.", "reason": "obsoleted"}
*/
-static constexpr const char *kRpcMessageCompressedSize = "rpc.message.compressed_size";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kRpcMessageCompressedSize =
+ "rpc.message.compressed_size";
/**
MUST be calculated as two different counters starting from @code 1 @endcode one for sent messages
- and one for received message. This way we guarantee that the values will be consistent between
- different implementations.
+ and one for received message.
+
+ @deprecated
+ {"note": "Deprecated, no replacement at this time.", "reason": "obsoleted"}
+
+ This way we guarantee that the values will be consistent between different implementations.
*/
-static constexpr const char *kRpcMessageId = "rpc.message.id";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kRpcMessageId = "rpc.message.id";
/**
Whether this is a received or sent message.
+
+ @deprecated
+ {"note": "Deprecated, no replacement at this time.", "reason": "obsoleted"}
*/
-static constexpr const char *kRpcMessageType = "rpc.message.type";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kRpcMessageType = "rpc.message.type";
/**
Uncompressed size of the message in bytes.
+
+ @deprecated
+ {"note": "Deprecated, no replacement at this time.", "reason": "obsoleted"}
*/
-static constexpr const char *kRpcMessageUncompressedSize = "rpc.message.uncompressed_size";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kRpcMessageUncompressedSize =
+ "rpc.message.uncompressed_size";
/**
The fully-qualified logical name of the method from the RPC interface perspective.
diff --git a/api/include/opentelemetry/semconv/incubating/rpc_metrics.h b/api/include/opentelemetry/semconv/incubating/rpc_metrics.h
index 755130a78b..fd12199814 100644
--- a/api/include/opentelemetry/semconv/incubating/rpc_metrics.h
+++ b/api/include/opentelemetry/semconv/incubating/rpc_metrics.h
@@ -21,7 +21,7 @@ namespace rpc
{
/**
- Measures the duration of outbound remote procedure calls (RPC).
+ Measures the duration of an outgoing Remote Procedure Call (RPC).
When this metric is reported alongside an RPC client span, the metric value
SHOULD be the same as the RPC client span duration.
@@ -30,7 +30,7 @@ namespace rpc
*/
static constexpr const char *kMetricRpcClientCallDuration = "rpc.client.call.duration";
static constexpr const char *descrMetricRpcClientCallDuration =
- "Measures the duration of outbound remote procedure calls (RPC).";
+ "Measures the duration of an outgoing Remote Procedure Call (RPC).";
static constexpr const char *unitMetricRpcClientCallDuration = "s";
static inline nostd::unique_ptr
Streaming: Recorded per message in a streaming batch
histogram
*/
-static constexpr const char *kMetricRpcClientRequestSize = "rpc.client.request.size";
-static constexpr const char *descrMetricRpcClientRequestSize =
+OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricRpcClientRequestSize =
+ "rpc.client.request.size";
+OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricRpcClientRequestSize =
"Measures the size of RPC request messages (uncompressed).";
-static constexpr const char *unitMetricRpcClientRequestSize = "By";
+OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricRpcClientRequestSize = "By";
-static inline nostd::unique_ptr
Streaming: Recorded per response in a streaming batch
histogram
*/
-static constexpr const char *kMetricRpcClientResponseSize = "rpc.client.response.size";
-static constexpr const char *descrMetricRpcClientResponseSize =
+OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricRpcClientResponseSize =
+ "rpc.client.response.size";
+OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricRpcClientResponseSize =
"Measures the size of RPC response messages (uncompressed).";
-static constexpr const char *unitMetricRpcClientResponseSize = "By";
+OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricRpcClientResponseSize = "By";
-static inline nostd::unique_ptr
When this metric is reported alongside an RPC server span, the metric value
SHOULD be the same as the RPC server span duration.
@@ -213,7 +221,7 @@ CreateSyncDoubleMetricRpcClientResponsesPerRpc(metrics::Meter *meter)
*/
static constexpr const char *kMetricRpcServerCallDuration = "rpc.server.call.duration";
static constexpr const char *descrMetricRpcServerCallDuration =
- "Measures the duration of inbound remote procedure calls (RPC).";
+ "Measures the duration of an incoming Remote Procedure Call (RPC).";
static constexpr const char *unitMetricRpcServerCallDuration = "s";
static inline nostd::unique_ptr
Streaming: Recorded per message in a streaming batch
histogram
*/
-static constexpr const char *kMetricRpcServerRequestSize = "rpc.server.request.size";
-static constexpr const char *descrMetricRpcServerRequestSize =
+OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricRpcServerRequestSize =
+ "rpc.server.request.size";
+OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricRpcServerRequestSize =
"Measures the size of RPC request messages (uncompressed).";
-static constexpr const char *unitMetricRpcServerRequestSize = "By";
+OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricRpcServerRequestSize = "By";
-static inline nostd::unique_ptr
Streaming: Recorded per response in a streaming batch
histogram
*/
-static constexpr const char *kMetricRpcServerResponseSize = "rpc.server.response.size";
-static constexpr const char *descrMetricRpcServerResponseSize =
+OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricRpcServerResponseSize =
+ "rpc.server.response.size";
+OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricRpcServerResponseSize =
"Measures the size of RPC response messages (uncompressed).";
-static constexpr const char *unitMetricRpcServerResponseSize = "By";
+OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricRpcServerResponseSize = "By";
-static inline nostd::unique_ptr
+ Application developers are encouraged to set @code service.criticality @endcode to express the
+ operational importance of their services. Telemetry consumers MAY use this attribute to optimize
+ telemetry collection or improve user experience.
+ */
+static constexpr const char *kServiceCriticality = "service.criticality";
+
/**
The string ID of the service instance.
@@ -92,6 +101,31 @@ static constexpr const char *kServicePeerNamespace = "service.peer.namespace";
*/
static constexpr const char *kServiceVersion = "service.version";
+namespace ServiceCriticalityValues
+{
+/**
+ Service is business-critical; downtime directly impacts revenue, user experience, or core
+ functionality.
+ */
+static constexpr const char *kCritical = "critical";
+
+/**
+ Service is important but has degradation tolerance or fallback mechanisms.
+ */
+static constexpr const char *kHigh = "high";
+
+/**
+ Service provides supplementary functionality; degradation has limited user impact.
+ */
+static constexpr const char *kMedium = "medium";
+
+/**
+ Service is non-essential to core operations; used for background tasks or internal tools.
+ */
+static constexpr const char *kLow = "low";
+
+} // namespace ServiceCriticalityValues
+
} // namespace service
} // namespace semconv
OPENTELEMETRY_END_NAMESPACE
diff --git a/api/include/opentelemetry/semconv/incubating/system_attributes.h b/api/include/opentelemetry/semconv/incubating/system_attributes.h
index 9a693ffc2e..da5447caf7 100644
--- a/api/include/opentelemetry/semconv/incubating/system_attributes.h
+++ b/api/include/opentelemetry/semconv/incubating/system_attributes.h
@@ -192,8 +192,8 @@ static constexpr const char *kFree = "free";
/**
@deprecated
- {"note": "Removed, report shared memory usage with @code metric.system.memory.shared @endcode
- metric", "reason": "uncategorized"}
+ {"note": "Removed, report shared memory usage with @code metric.system.memory.linux.shared
+ @endcode metric", "reason": "uncategorized"}
*/
OPENTELEMETRY_DEPRECATED static constexpr const char *kShared = "shared";
diff --git a/api/include/opentelemetry/semconv/incubating/system_metrics.h b/api/include/opentelemetry/semconv/incubating/system_metrics.h
index a9f6f38c03..bff7940670 100644
--- a/api/include/opentelemetry/semconv/incubating/system_metrics.h
+++ b/api/include/opentelemetry/semconv/incubating/system_metrics.h
@@ -779,6 +779,51 @@ CreateAsyncDoubleMetricSystemMemoryLinuxAvailable(metrics::Meter *meter)
unitMetricSystemMemoryLinuxAvailable);
}
+/**
+ Shared memory used (mostly by tmpfs).
+
+ Equivalent of @code shared @endcode from @code free @endcode command or
+ @code Shmem @endcode from @code
+ /proc/meminfo @endcode" updowncounter
+ */
+static constexpr const char *kMetricSystemMemoryLinuxShared = "system.memory.linux.shared";
+static constexpr const char *descrMetricSystemMemoryLinuxShared =
+ "Shared memory used (mostly by tmpfs).";
+static constexpr const char *unitMetricSystemMemoryLinuxShared = "By";
+
+static inline nostd::unique_ptr
@@ -828,40 +873,40 @@ CreateAsyncDoubleMetricSystemMemoryLinuxSlabUsage(metrics::Meter *meter)
}
/**
- Shared memory used (mostly by tmpfs).
-
- Equivalent of @code shared @endcode from @code free @endcode command or
- @code Shmem @endcode from @code
- /proc/meminfo @endcode" updowncounter
+ Deprecated, use @code system.memory.linux.shared @endcode instead.
+
+ @deprecated
+ {"note": "Replaced by @code system.memory.linux.shared @endcode.", "reason": "renamed",
+ "renamed_to": "system.memory.linux.shared"} updowncounter
*/
-static constexpr const char *kMetricSystemMemoryShared = "system.memory.shared";
-static constexpr const char *descrMetricSystemMemoryShared =
- "Shared memory used (mostly by tmpfs).";
-static constexpr const char *unitMetricSystemMemoryShared = "By";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricSystemMemoryShared =
+ "system.memory.shared";
+OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricSystemMemoryShared =
+ "Deprecated, use `system.memory.linux.shared` instead.";
+OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricSystemMemoryShared = "By";
-static inline nostd::unique_ptr
This list is subject to change over time.
+ Matching of query parameter keys against the sensitive list SHOULD be case-sensitive.
+
+
+ Instrumentation MAY provide a way to override this list via declarative configuration.
+ If so, it SHOULD use the @code sensitive_query_parameters @endcode property
+ (an array of case-sensitive strings with minimum items 0) under
+ @code .instrumentation/development.general.sanitization.url @endcode.
+ This list is a full override of the default sensitive query parameter keys,
+ it is not a list of keys in addition to the defaults.
+
When a query string value is redacted, the query string key SHOULD still be preserved, e.g.
@code https://www.example.com/path?color=blue&sig=REDACTED @endcode.
*/
@@ -123,6 +133,15 @@ static constexpr const char *kUrlPort = "url.port";
This list is subject to change over time.
+ Matching of query parameter keys against the sensitive list SHOULD be case-sensitive.
+
+ Instrumentation MAY provide a way to override this list via declarative configuration.
+ If so, it SHOULD use the @code sensitive_query_parameters @endcode property
+ (an array of case-sensitive strings with minimum items 0) under
+ @code .instrumentation/development.general.sanitization.url @endcode.
+ This list is a full override of the default sensitive query parameter keys,
+ it is not a list of keys in addition to the defaults.
+
When a query string value is redacted, the query string key SHOULD still be preserved, e.g.
@code q=OpenTelemetry&sig=REDACTED @endcode.
*/
diff --git a/api/include/opentelemetry/semconv/schema_url.h b/api/include/opentelemetry/semconv/schema_url.h
index 5acdd1dd7b..4a71a69d9d 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.39.0";
+static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.40.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 d0a5f33c79..b6f798d2fa 100644
--- a/api/include/opentelemetry/semconv/service_attributes.h
+++ b/api/include/opentelemetry/semconv/service_attributes.h
@@ -19,6 +19,37 @@ namespace semconv
namespace service
{
+/**
+ The string ID of the service instance.
+
+ MUST be unique for each instance of the same @code service.namespace,service.name @endcode pair
+ (in other words
+ @code service.namespace,service.name,service.instance.id @endcode triplet MUST be globally
+ unique). The ID helps to distinguish instances of the same service that exist at the same time
+ (e.g. instances of a horizontally scaled service). Implementations, such as SDKs, are
+ recommended to generate a random Version 1 or Version 4 RFC 4122 UUID, but are free to use an inherent
+ unique ID as the source of this value if stability is desirable. In that case, the ID SHOULD be
+ used as source of a UUID Version 5 and SHOULD use the following UUID as the namespace: @code
+ 4d63009a-8d0f-11ee-aad7-4c796ed8e320 @endcode. UUIDs are typically recommended, as only an
+ opaque value for the purposes of identifying a service instance is needed. Similar to what can be
+ seen in the man page for the @code
+ /etc/machine-id @endcode file, the underlying data, such as pod name and namespace should be
+ treated as confidential, being the user's choice to expose it or not via another resource
+ attribute. For applications running behind an application server (like unicorn), we do not
+ recommend using one identifier for all processes participating in the application. Instead, it's
+ recommended each division (e.g. a worker thread in unicorn) to have its own instance.id. It's
+ not recommended for a Collector to set @code service.instance.id @endcode if it can't
+ unambiguously determine the service instance that is generating that telemetry. For instance,
+ creating an UUID based on @code pod.name @endcode will likely be wrong, as the Collector might not
+ know from which container within that pod the telemetry originated. However, Collectors can set
+ the @code service.instance.id @endcode if they can unambiguously determine the service instance
+ for that telemetry. This is typically the case for scraping receivers, as they know the target
+ address and port.
+ */
+static constexpr const char *kServiceInstanceId = "service.instance.id";
+
/**
Logical name of the service.
@@ -30,6 +61,18 @@ namespace service
*/
static constexpr const char *kServiceName = "service.name";
+/**
+ A namespace for @code service.name @endcode.
+
+ A string value having a meaning that helps to distinguish a group of services, for example the
+ team name that owns a group of services. @code service.name @endcode is expected to be unique
+ within the same namespace. If @code service.namespace @endcode is not specified in the Resource
+ then @code service.name @endcode is expected to be unique for all services that have no explicit
+ namespace defined (so the empty/unspecified namespace is simply one more valid namespace).
+ Zero-length namespace string is assumed equal to unspecified namespace.
+ */
+static constexpr const char *kServiceNamespace = "service.namespace";
+
/**
The version string of the service component. The format is not defined by these conventions.
*/
diff --git a/api/include/opentelemetry/semconv/url_attributes.h b/api/include/opentelemetry/semconv/url_attributes.h
index 316b60e9a9..9bfa6b1fea 100644
--- a/api/include/opentelemetry/semconv/url_attributes.h
+++ b/api/include/opentelemetry/semconv/url_attributes.h
@@ -53,6 +53,16 @@ static constexpr const char *kUrlFragment = "url.fragment";
This list is subject to change over time.
+ Matching of query parameter keys against the sensitive list SHOULD be case-sensitive.
+
+
+ Instrumentation MAY provide a way to override this list via declarative configuration.
+ If so, it SHOULD use the @code sensitive_query_parameters @endcode property
+ (an array of case-sensitive strings with minimum items 0) under
+ @code .instrumentation/development.general.sanitization.url @endcode.
+ This list is a full override of the default sensitive query parameter keys,
+ it is not a list of keys in addition to the defaults.
+
When a query string value is redacted, the query string key SHOULD still be preserved, e.g.
@code https://www.example.com/path?color=blue&sig=REDACTED @endcode.
*/
@@ -86,6 +96,15 @@ static constexpr const char *kUrlPath = "url.path";
This list is subject to change over time.
+ Matching of query parameter keys against the sensitive list SHOULD be case-sensitive.
+
+ Instrumentation MAY provide a way to override this list via declarative configuration.
+ If so, it SHOULD use the @code sensitive_query_parameters @endcode property
+ (an array of case-sensitive strings with minimum items 0) under
+ @code .instrumentation/development.general.sanitization.url @endcode.
+ This list is a full override of the default sensitive query parameter keys,
+ it is not a list of keys in addition to the defaults.
+
When a query string value is redacted, the query string key SHOULD still be preserved, e.g.
@code q=OpenTelemetry&sig=REDACTED @endcode.
*/
diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh
index a80b9daa70..453a4dea95 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.39.0
+SEMCONV_VERSION=1.40.0
# repository: https://github.com/open-telemetry/weaver
-WEAVER_VERSION=0.20.0
+WEAVER_VERSION=0.21.2
SEMCONV_VERSION_TAG=v$SEMCONV_VERSION
WEAVER_VERSION_TAG=v$WEAVER_VERSION
+ */
+static constexpr const char *kK8sServiceAnnotation = "k8s.service.annotation";
+
+/**
+ The address type of the service endpoint.
+
+ */
+static constexpr const char *kK8sServiceLabel = "k8s.service.label";
+
+/**
+ The name of the Service.
+ */
+static constexpr const char *kK8sServiceName = "k8s.service.name";
+
+/**
+ Whether the Service publishes not-ready endpoints.
+
+ */
+static constexpr const char *kK8sServiceSelector = "k8s.service.selector";
+
+/**
+ The traffic distribution policy for the Service.
+
+