From df498b07769198692a0553b6f9012cf9056ae226 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sat, 7 May 2022 04:49:44 +0530 Subject: [PATCH 1/2] Update to semantic conventions v1.11.0 --- .../semconv/resource/__init__.py | 8 ++- .../opentelemetry/semconv/trace/__init__.py | 70 +++++++++++++++++-- scripts/semconv/generate.sh | 4 +- 3 files changed, 75 insertions(+), 7 deletions(-) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py index 710c30a77b..dc24d22b5f 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py @@ -150,6 +150,12 @@ class ResourceAttributes: Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative. """ + DEVICE_MANUFACTURER = "device.manufacturer" + """ + The name of the device manufacturer. + Note: The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps SHOULD hardcode the value `Apple`. + """ + FAAS_NAME = "faas.name" """ The name of the single function that this runtime instance executes. @@ -610,7 +616,7 @@ class OsTypeValues(Enum): """AIX (Advanced Interactive eXecutive).""" SOLARIS = "solaris" - """Oracle Solaris.""" + """SunOS, Oracle Solaris.""" Z_OS = "z_os" """IBM z/OS.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py index a762d88c2c..36bab3d1a1 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py @@ -24,6 +24,37 @@ class SpanAttributes: Note: This may be different from `faas.id` if an alias is involved. """ + CLOUDEVENTS_EVENT_ID = "cloudevents.event_id" + """ + The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. + """ + + CLOUDEVENTS_EVENT_SOURCE = "cloudevents.event_source" + """ + The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. + """ + + CLOUDEVENTS_EVENT_SPEC_VERSION = "cloudevents.event_spec_version" + """ + The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. + """ + + CLOUDEVENTS_EVENT_TYPE = "cloudevents.event_type" + """ + The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. + """ + + CLOUDEVENTS_EVENT_SUBJECT = "cloudevents.event_subject" + """ + The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). + """ + + OPENTRACING_REF_TYPE = "opentracing.ref_type" + """ + Parent-child Reference type. + Note: The causal relationship between a child Span and a parent Span. + """ + DB_SYSTEM = "db.system" """ An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. @@ -65,6 +96,7 @@ class SpanAttributes: NET_PEER_NAME = "net.peer.name" """ Remote hostname or similar, see note below. + Note: `net.peer.name` SHOULD NOT be set if capturing it would require an extra DNS lookup. """ NET_PEER_IP = "net.peer.ip" @@ -170,7 +202,7 @@ class SpanAttributes: whether it will escape the scope of a span. However, it is trivial to know that an exception will escape, if one checks for an active exception just before ending the span, -as done in the [example above](#exception-end-example). +as done in the [example above](#recording-an-exception). It follows that an exception may still escape the scope of the span even if the `exception.escaped` attribute was not set or set to false, @@ -284,6 +316,11 @@ class SpanAttributes: The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used. """ + HTTP_RETRY_COUNT = "http.retry_count" + """ + The ordinal number of request re-sending attempt. + """ + HTTP_SERVER_NAME = "http.server_name" """ The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). @@ -762,6 +799,14 @@ class SpanAttributes: """ +class OpentracingRefTypeValues(Enum): + CHILD_OF = "child_of" + """The parent Span depends on the child Span in some capacity.""" + + FOLLOWS_FROM = "follows_from" + """The parent Span does not depend in any way on the result of the child Span.""" + + class DbSystemValues(Enum): OTHER_SQL = "other_sql" """Some other SQL database. Fallback only. See notes.""" @@ -993,13 +1038,16 @@ class FaasDocumentOperationValues(Enum): class HttpFlavorValues(Enum): HTTP_1_0 = "1.0" - """HTTP 1.0.""" + """HTTP/1.0.""" HTTP_1_1 = "1.1" - """HTTP 1.1.""" + """HTTP/1.1.""" HTTP_2_0 = "2.0" - """HTTP 2.""" + """HTTP/2.""" + + HTTP_3_0 = "3.0" + """HTTP/3.""" SPDY = "SPDY" """SPDY protocol.""" @@ -1115,6 +1163,20 @@ class FaasInvokedProviderValues(Enum): """Tencent Cloud.""" +class RpcSystemValues(Enum): + GRPC = "grpc" + """gRPC.""" + + JAVA_RMI = "java_rmi" + """Java RMI.""" + + DOTNET_WCF = "dotnet_wcf" + """.NET WCF.""" + + APACHE_DUBBO = "apache_dubbo" + """Apache Dubbo.""" + + class MessagingOperationValues(Enum): RECEIVE = "receive" """receive.""" diff --git a/scripts/semconv/generate.sh b/scripts/semconv/generate.sh index 48c46a78c6..866832fe6b 100755 --- a/scripts/semconv/generate.sh +++ b/scripts/semconv/generate.sh @@ -4,8 +4,8 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ROOT_DIR="${SCRIPT_DIR}/../../" # freeze the spec version to make SemanticAttributes generation reproducible -SPEC_VERSION=v1.8.0 -OTEL_SEMCONV_GEN_IMG_VERSION=0.9.0 +SPEC_VERSION=v1.11.0 +OTEL_SEMCONV_GEN_IMG_VERSION=0.11.1 cd ${SCRIPT_DIR} From 6f2a116b4675fa7b812581562a0a9db2e0fa6204 Mon Sep 17 00:00:00 2001 From: Srikanth Chekuri Date: Sat, 7 May 2022 05:25:18 +0530 Subject: [PATCH 2/2] Add CHANGELOG entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1614019b28..69fc246285 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v1.11.1-0.30b1...HEAD) +- Update to semantic conventions v1.11.0 + ([#2669](https://github.com/open-telemetry/opentelemetry-python/pull/2669)) - Add timeouts to metric SDK ([#2653](https://github.com/open-telemetry/opentelemetry-python/pull/2653)) - Add variadic arguments to metric exporter/reader interfaces