Skip to content

Commit 8006a49

Browse files
authored
Bump semantic conventions from 1.6.1 to 1.8.0 (open-telemetry#2461)
1 parent a01c49f commit 8006a49

File tree

4 files changed

+157
-22
lines changed

4 files changed

+157
-22
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
([#2442](https://github.com/open-telemetry/opentelemetry-python/pull/2442))
1212
- bugfix(auto-instrumentation): attach OTLPHandler to root logger
1313
([#2450](https://github.com/open-telemetry/opentelemetry-python/pull/2450))
14+
- Bump semantic conventions from 1.6.1 to 1.8.0
15+
([#2461](https://github.com/open-telemetry/opentelemetry-python/pull/2461))
1416

1517
## [1.9.1-0.28b1](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.9.1-0.28b1) - 2022-01-29
1618

opentelemetry-semantic-conventions/src/opentelemetry/semconv/resource/__init__.py

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ class ResourceAttributes:
2828

2929
CLOUD_REGION = "cloud.region"
3030
"""
31-
The geographical region the resource is running. Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), or [Google Cloud regions](https://cloud.google.com/about/locations).
31+
The geographical region the resource is running.
32+
Note: Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://intl.cloud.tencent.com/document/product/213/6091).
3233
"""
3334

3435
CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone"
@@ -103,7 +104,7 @@ class ResourceAttributes:
103104

104105
CONTAINER_NAME = "container.name"
105106
"""
106-
Container name.
107+
Container name used by container runtime.
107108
"""
108109

109110
CONTAINER_ID = "container.id"
@@ -267,7 +268,12 @@ class ResourceAttributes:
267268

268269
K8S_CONTAINER_NAME = "k8s.container.name"
269270
"""
270-
The name of the Container in a Pod template.
271+
The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`).
272+
"""
273+
274+
K8S_CONTAINER_RESTART_COUNT = "k8s.container.restart_count"
275+
"""
276+
Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec.
271277
"""
272278

273279
K8S_REPLICASET_UID = "k8s.replicaset.uid"
@@ -472,6 +478,9 @@ class CloudProviderValues(Enum):
472478
GCP = "gcp"
473479
"""Google Cloud Platform."""
474480

481+
TENCENT_CLOUD = "tencent_cloud"
482+
"""Tencent Cloud."""
483+
475484

476485
class CloudPlatformValues(Enum):
477486
ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs"
@@ -495,6 +504,9 @@ class CloudPlatformValues(Enum):
495504
AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk"
496505
"""AWS Elastic Beanstalk."""
497506

507+
AWS_APP_RUNNER = "aws_app_runner"
508+
"""AWS App Runner."""
509+
498510
AZURE_VM = "azure_vm"
499511
"""Azure Virtual Machines."""
500512

@@ -525,6 +537,15 @@ class CloudPlatformValues(Enum):
525537
GCP_APP_ENGINE = "gcp_app_engine"
526538
"""Google Cloud App Engine (GAE)."""
527539

540+
TENCENT_CLOUD_CVM = "tencent_cloud_cvm"
541+
"""Tencent Cloud Cloud Virtual Machine (CVM)."""
542+
543+
TENCENT_CLOUD_EKS = "tencent_cloud_eks"
544+
"""Tencent Cloud Elastic Kubernetes Service (EKS)."""
545+
546+
TENCENT_CLOUD_SCF = "tencent_cloud_scf"
547+
"""Tencent Cloud Serverless Cloud Function (SCF)."""
548+
528549

529550
class AwsEcsLaunchtypeValues(Enum):
530551
EC2 = "ec2"
@@ -553,6 +574,9 @@ class HostArchValues(Enum):
553574
PPC64 = "ppc64"
554575
"""64-bit PowerPC."""
555576

577+
S390X = "s390x"
578+
"""IBM z/Architecture."""
579+
556580
X86 = "x86"
557581
"""32-bit x86."""
558582

@@ -622,3 +646,6 @@ class TelemetrySdkLanguageValues(Enum):
622646

623647
WEBJS = "webjs"
624648
"""webjs."""
649+
650+
SWIFT = "swift"
651+
"""swift."""

opentelemetry-semantic-conventions/src/opentelemetry/semconv/trace/__init__.py

Lines changed: 123 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class SpanAttributes:
4646

4747
DB_NAME = "db.name"
4848
"""
49-
If no [tech-specific attribute](#call-level-attributes-for-specific-technologies) is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails).
50-
Note: In some SQL databases, the database name to be used is called "schema name".
49+
This attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails).
50+
Note: In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name).
5151
"""
5252

5353
DB_STATEMENT = "db.statement"
@@ -88,11 +88,6 @@ class SpanAttributes:
8888
Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard).
8989
"""
9090

91-
DB_CASSANDRA_KEYSPACE = "db.cassandra.keyspace"
92-
"""
93-
The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute.
94-
"""
95-
9691
DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size"
9792
"""
9893
The fetch size used for paging, i.e. how many rows will be returned at once.
@@ -105,7 +100,7 @@ class SpanAttributes:
105100

106101
DB_CASSANDRA_TABLE = "db.cassandra.table"
107102
"""
108-
The name of the primary table that the operation is acting upon, including the schema name (if applicable).
103+
The name of the primary table that the operation is acting upon, including the keyspace name (if applicable).
109104
Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.
110105
"""
111106

@@ -131,11 +126,6 @@ class SpanAttributes:
131126
The data center of the coordinating node for a query.
132127
"""
133128

134-
DB_HBASE_NAMESPACE = "db.hbase.namespace"
135-
"""
136-
The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute.
137-
"""
138-
139129
DB_REDIS_DATABASE_INDEX = "db.redis.database_index"
140130
"""
141131
The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute.
@@ -148,7 +138,7 @@ class SpanAttributes:
148138

149139
DB_SQL_TABLE = "db.sql.table"
150140
"""
151-
The name of the primary table that the operation is acting upon, including the schema name (if applicable).
141+
The name of the primary table that the operation is acting upon, including the database name (if applicable).
152142
Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.
153143
"""
154144

@@ -190,7 +180,16 @@ class SpanAttributes:
190180

191181
FAAS_TRIGGER = "faas.trigger"
192182
"""
193-
Type of the trigger on which the function is executed.
183+
Type of the trigger which caused this function execution.
184+
Note: For the server/consumer span on the incoming side,
185+
`faas.trigger` MUST be set.
186+
187+
Clients invoking FaaS instances usually cannot set `faas.trigger`,
188+
since they would typically need to look in the payload to determine
189+
the event type. If clients set it, it should be the same as the
190+
trigger that corresponding incoming would have (i.e., this has
191+
nothing to do with the underlying transport used to make the API
192+
call to invoke the lambda, which is often HTTP).
194193
"""
195194

196195
FAAS_EXECUTION = "faas.execution"
@@ -236,7 +235,8 @@ class SpanAttributes:
236235

237236
HTTP_HOST = "http.host"
238237
"""
239-
The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is empty or not present, this attribute should be the same.
238+
The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header should also be reported, see note.
239+
Note: When the header is present but empty the attribute SHOULD be set to the empty string. Note that this is a valid situation that is expected in certain cases, according the aforementioned [section of RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not set the attribute MUST NOT be set.
240240
"""
241241

242242
HTTP_SCHEME = "http.scheme"
@@ -298,7 +298,17 @@ class SpanAttributes:
298298
HTTP_CLIENT_IP = "http.client_ip"
299299
"""
300300
The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)).
301-
Note: This is not necessarily the same as `net.peer.ip`, which would identify the network-level peer, which may be a proxy.
301+
Note: This is not necessarily the same as `net.peer.ip`, which would
302+
identify the network-level peer, which may be a proxy.
303+
304+
This attribute should be set when a source of information different
305+
from the one used for `net.peer.ip`, is available even if that other
306+
source just confirms the same value as `net.peer.ip`.
307+
Rationale: For `net.peer.ip`, one typically does not know if it
308+
comes from a proxy, reverse proxy, or the actual client. Setting
309+
`http.client_ip` when it's the same as `net.peer.ip` means that
310+
one is at least somewhat confident that the address is not that of
311+
the closest proxy.
302312
"""
303313

304314
NET_HOST_IP = "net.host.ip"
@@ -632,6 +642,11 @@ class SpanAttributes:
632642
A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case.
633643
"""
634644

645+
MESSAGING_CONSUMER_ID = "messaging.consumer_id"
646+
"""
647+
The identifier for the consumer receiving a message. For Kafka, set it to `{messaging.kafka.consumer_group} - {messaging.kafka.client_id}`, if both are present, or only `messaging.kafka.consumer_group`. For brokers, such as RabbitMQ and Artemis, set it to the `client_id` of the client consuming the message.
648+
"""
649+
635650
MESSAGING_RABBITMQ_ROUTING_KEY = "messaging.rabbitmq.routing_key"
636651
"""
637652
RabbitMQ message routing key.
@@ -663,6 +678,43 @@ class SpanAttributes:
663678
A boolean that is true if the message is a tombstone.
664679
"""
665680

681+
MESSAGING_ROCKETMQ_NAMESPACE = "messaging.rocketmq.namespace"
682+
"""
683+
Namespace of RocketMQ resources, resources in different namespaces are individual.
684+
"""
685+
686+
MESSAGING_ROCKETMQ_CLIENT_GROUP = "messaging.rocketmq.client_group"
687+
"""
688+
Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind.
689+
"""
690+
691+
MESSAGING_ROCKETMQ_CLIENT_ID = "messaging.rocketmq.client_id"
692+
"""
693+
The unique identifier for each client.
694+
"""
695+
696+
MESSAGING_ROCKETMQ_MESSAGE_TYPE = "messaging.rocketmq.message_type"
697+
"""
698+
Type of message.
699+
"""
700+
701+
MESSAGING_ROCKETMQ_MESSAGE_TAG = "messaging.rocketmq.message_tag"
702+
"""
703+
The secondary classifier of message besides topic.
704+
"""
705+
706+
MESSAGING_ROCKETMQ_MESSAGE_KEYS = "messaging.rocketmq.message_keys"
707+
"""
708+
Key(s) of message, another way to mark message besides message id.
709+
"""
710+
711+
MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = (
712+
"messaging.rocketmq.consumption_model"
713+
)
714+
"""
715+
Model of message consumption. This only applies to consumer spans.
716+
"""
717+
666718
RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code"
667719
"""
668720
The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request.
@@ -688,6 +740,27 @@ class SpanAttributes:
688740
`error.message` property of response if it is an error response.
689741
"""
690742

743+
MESSAGE_TYPE = "message.type"
744+
"""
745+
Whether this is a received or sent message.
746+
"""
747+
748+
MESSAGE_ID = "message.id"
749+
"""
750+
MUST be calculated as two different counters starting from `1` one for sent messages and one for received message.
751+
Note: This way we guarantee that the values will be consistent between different implementations.
752+
"""
753+
754+
MESSAGE_COMPRESSED_SIZE = "message.compressed_size"
755+
"""
756+
Compressed size of the message in bytes.
757+
"""
758+
759+
MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size"
760+
"""
761+
Uncompressed size of the message in bytes.
762+
"""
763+
691764

692765
class DbSystemValues(Enum):
693766
OTHER_SQL = "other_sql"
@@ -1038,6 +1111,9 @@ class FaasInvokedProviderValues(Enum):
10381111
GCP = "gcp"
10391112
"""Google Cloud Platform."""
10401113

1114+
TENCENT_CLOUD = "tencent_cloud"
1115+
"""Tencent Cloud."""
1116+
10411117

10421118
class MessagingOperationValues(Enum):
10431119
RECEIVE = "receive"
@@ -1047,6 +1123,28 @@ class MessagingOperationValues(Enum):
10471123
"""process."""
10481124

10491125

1126+
class MessagingRocketmqMessageTypeValues(Enum):
1127+
NORMAL = "normal"
1128+
"""Normal message."""
1129+
1130+
FIFO = "fifo"
1131+
"""FIFO message."""
1132+
1133+
DELAY = "delay"
1134+
"""Delay message."""
1135+
1136+
TRANSACTION = "transaction"
1137+
"""Transaction message."""
1138+
1139+
1140+
class MessagingRocketmqConsumptionModelValues(Enum):
1141+
CLUSTERING = "clustering"
1142+
"""Clustering consumption model."""
1143+
1144+
BROADCASTING = "broadcasting"
1145+
"""Broadcasting consumption model."""
1146+
1147+
10501148
class RpcGrpcStatusCodeValues(Enum):
10511149
OK = 0
10521150
"""OK."""
@@ -1098,3 +1196,11 @@ class RpcGrpcStatusCodeValues(Enum):
10981196

10991197
UNAUTHENTICATED = 16
11001198
"""UNAUTHENTICATED."""
1199+
1200+
1201+
class MessageTypeValues(Enum):
1202+
SENT = "SENT"
1203+
"""sent."""
1204+
1205+
RECEIVED = "RECEIVED"
1206+
"""received."""

scripts/semconv/generate.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
44
ROOT_DIR="${SCRIPT_DIR}/../../"
55

66
# freeze the spec version to make SemanticAttributes generation reproducible
7-
SPEC_VERSION=v1.6.1
8-
OTEL_SEMCONV_GEN_IMG_VERSION=0.5.0
7+
SPEC_VERSION=v1.8.0
8+
OTEL_SEMCONV_GEN_IMG_VERSION=0.9.0
99

1010
cd ${SCRIPT_DIR}
1111

0 commit comments

Comments
 (0)