Skip to content

Commit 159044d

Browse files
ahayworthfbogsany
andauthored
Bump semantic_conventions gem to 1.10.0 (#1171)
* chore: bump semconvgen from 0.4.1 -> 0.11.1 I couldn't find any huge changes from the release notes; it seems the generated wording was improved in some cases. Regardless, let us not drift too far behind. * feat!: update for semantic conventions @ v1.10.0 The most notable thing here is that the delta between 1.8.0 and 1.10.0 results in a few fields going away. This will be a breaking change for anyone who happens to be depending upon these fields: - `DB_CASSANDRA_KEYSPACE` - `DB_HBASE_NAMESPACE` Users should instead use `DB_NAME`, according to [open-telemetry/opentelemetry-specification#1973](open-telemetry/opentelemetry-specification#1973). Otherwise, we get the standard deal: - A plethora of new, exciting fields! - Reworded explanatory text! Overall, not a terribly exciting change, but we must often take joy in the small things, and I choose to do so here! Co-authored-by: Francis Bogsanyi <[email protected]>
1 parent b22c5c6 commit 159044d

File tree

4 files changed

+94
-17
lines changed

4 files changed

+94
-17
lines changed

semantic_conventions/Rakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require 'yard'
1010
require 'rubocop/rake_task'
1111
require 'tmpdir'
1212

13-
SPEC_VERSION = '1.8.0'
13+
SPEC_VERSION = '1.10.0'
1414

1515
RuboCop::RakeTask.new
1616

@@ -47,7 +47,7 @@ task :generate do
4747
-v "#{tmpdir}/semantic_conventions/#{kind}":/source
4848
-v "#{cwd}/templates":/templates
4949
-v "#{cwd}/lib":/output
50-
otel/semconvgen:0.4.1
50+
otel/semconvgen:0.11.1
5151
-f /source code
5252
--template /templates/semantic_conventions.j2
5353
--output /output/opentelemetry/semantic_conventions/#{kind}.rb

semantic_conventions/lib/opentelemetry/semantic_conventions/resource.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ module Resource
9191
# @note It's recommended this value represents a human readable version of the device model rather than a machine readable alternative
9292
DEVICE_MODEL_NAME = 'device.model.name'
9393

94+
# The name of the device manufacturer
95+
# @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`
96+
DEVICE_MANUFACTURER = 'device.manufacturer'
97+
9498
# The name of the single function that this runtime instance executes
9599
# @note This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the [`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes) span attributes)
96100
FAAS_NAME = 'faas.name'

semantic_conventions/lib/opentelemetry/semantic_conventions/trace.rb

Lines changed: 87 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,25 @@ module Trace
1111
# @note This may be different from `faas.id` if an alias is involved
1212
AWS_LAMBDA_INVOKED_ARN = 'aws.lambda.invoked_arn'
1313

14+
# The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event
15+
CLOUDEVENTS_EVENT_ID = 'cloudevents.event_id'
16+
17+
# The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened
18+
CLOUDEVENTS_EVENT_SOURCE = 'cloudevents.event_source'
19+
20+
# The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses
21+
CLOUDEVENTS_EVENT_SPEC_VERSION = 'cloudevents.event_spec_version'
22+
23+
# 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
24+
CLOUDEVENTS_EVENT_TYPE = 'cloudevents.event_type'
25+
26+
# 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)
27+
CLOUDEVENTS_EVENT_SUBJECT = 'cloudevents.event_subject'
28+
29+
# Parent-child Reference type
30+
# @note The causal relationship between a child Span and a parent Span
31+
OPENTRACING_REF_TYPE = 'opentracing.ref_type'
32+
1433
# An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers
1534
DB_SYSTEM = 'db.system'
1635

@@ -23,8 +42,8 @@ module Trace
2342
# The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect
2443
DB_JDBC_DRIVER_CLASSNAME = 'db.jdbc.driver_classname'
2544

26-
# 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)
27-
# @note In some SQL databases, the database name to be used is called "schema name"
45+
# 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)
46+
# @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)
2847
DB_NAME = 'db.name'
2948

3049
# The database statement being executed
@@ -51,16 +70,13 @@ module Trace
5170
# @note If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard)
5271
DB_MSSQL_INSTANCE_NAME = 'db.mssql.instance_name'
5372

54-
# The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute
55-
DB_CASSANDRA_KEYSPACE = 'db.cassandra.keyspace'
56-
5773
# The fetch size used for paging, i.e. how many rows will be returned at once
5874
DB_CASSANDRA_PAGE_SIZE = 'db.cassandra.page_size'
5975

6076
# The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html)
6177
DB_CASSANDRA_CONSISTENCY_LEVEL = 'db.cassandra.consistency_level'
6278

63-
# The name of the primary table that the operation is acting upon, including the schema name (if applicable)
79+
# The name of the primary table that the operation is acting upon, including the keyspace name (if applicable)
6480
# @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
6581
DB_CASSANDRA_TABLE = 'db.cassandra.table'
6682

@@ -76,16 +92,13 @@ module Trace
7692
# The data center of the coordinating node for a query
7793
DB_CASSANDRA_COORDINATOR_DC = 'db.cassandra.coordinator.dc'
7894

79-
# The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute
80-
DB_HBASE_NAMESPACE = 'db.hbase.namespace'
81-
8295
# 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
8396
DB_REDIS_DATABASE_INDEX = 'db.redis.database_index'
8497

8598
# The collection being accessed within the database stated in `db.name`
8699
DB_MONGODB_COLLECTION = 'db.mongodb.collection'
87100

88-
# The name of the primary table that the operation is acting upon, including the schema name (if applicable)
101+
# The name of the primary table that the operation is acting upon, including the database name (if applicable)
89102
# @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
90103
DB_SQL_TABLE = 'db.sql.table'
91104

@@ -109,15 +122,24 @@ module Trace
109122
# whether it will escape the scope of a span.
110123
# However, it is trivial to know that an exception
111124
# will escape, if one checks for an active exception just before ending the span,
112-
# as done in the [example above](#exception-end-example).
125+
# as done in the [example above](#recording-an-exception).
113126
#
114127
# It follows that an exception may still escape the scope of the span
115128
# even if the `exception.escaped` attribute was not set or set to false,
116129
# since the event might have been recorded at a time where it was not
117130
# clear whether the exception will escape
118131
EXCEPTION_ESCAPED = 'exception.escaped'
119132

120-
# Type of the trigger on which the function is executed
133+
# Type of the trigger which caused this function execution
134+
# @note For the server/consumer span on the incoming side,
135+
# `faas.trigger` MUST be set.
136+
#
137+
# Clients invoking FaaS instances usually cannot set `faas.trigger`,
138+
# since they would typically need to look in the payload to determine
139+
# the event type. If clients set it, it should be the same as the
140+
# trigger that corresponding incoming would have (i.e., this has
141+
# nothing to do with the underlying transport used to make the API
142+
# call to invoke the lambda, which is often HTTP)
121143
FAAS_TRIGGER = 'faas.trigger'
122144

123145
# The execution ID of the current function execution
@@ -145,7 +167,8 @@ module Trace
145167
# The full request target as passed in a HTTP request line or equivalent
146168
HTTP_TARGET = 'http.target'
147169

148-
# 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
170+
# 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
171+
# @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
149172
HTTP_HOST = 'http.host'
150173

151174
# The URI scheme identifying the used protocol
@@ -173,6 +196,9 @@ module Trace
173196
# The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used
174197
HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = 'http.response_content_length_uncompressed'
175198

199+
# The ordinal number of request re-sending attempt
200+
HTTP_RETRY_COUNT = 'http.retry_count'
201+
176202
# 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)
177203
# @note `http.url` is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is available
178204
HTTP_SERVER_NAME = 'http.server_name'
@@ -181,7 +207,17 @@ module Trace
181207
HTTP_ROUTE = 'http.route'
182208

183209
# 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))
184-
# @note This is not necessarily the same as `net.peer.ip`, which would identify the network-level peer, which may be a proxy
210+
# @note This is not necessarily the same as `net.peer.ip`, which would
211+
# identify the network-level peer, which may be a proxy.
212+
#
213+
# This attribute should be set when a source of information different
214+
# from the one used for `net.peer.ip`, is available even if that other
215+
# source just confirms the same value as `net.peer.ip`.
216+
# Rationale: For `net.peer.ip`, one typically does not know if it
217+
# comes from a proxy, reverse proxy, or the actual client. Setting
218+
# `http.client_ip` when it's the same as `net.peer.ip` means that
219+
# one is at least somewhat confident that the address is not that of
220+
# the closest proxy
185221
HTTP_CLIENT_IP = 'http.client_ip'
186222

187223
# Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host
@@ -375,6 +411,9 @@ module Trace
375411
# 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
376412
MESSAGING_OPERATION = 'messaging.operation'
377413

414+
# 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
415+
MESSAGING_CONSUMER_ID = 'messaging.consumer_id'
416+
378417
# RabbitMQ message routing key
379418
MESSAGING_RABBITMQ_ROUTING_KEY = 'messaging.rabbitmq.routing_key'
380419

@@ -394,6 +433,27 @@ module Trace
394433
# A boolean that is true if the message is a tombstone
395434
MESSAGING_KAFKA_TOMBSTONE = 'messaging.kafka.tombstone'
396435

436+
# Namespace of RocketMQ resources, resources in different namespaces are individual
437+
MESSAGING_ROCKETMQ_NAMESPACE = 'messaging.rocketmq.namespace'
438+
439+
# Name of the RocketMQ producer/consumer group that is handling the message. The client type is identified by the SpanKind
440+
MESSAGING_ROCKETMQ_CLIENT_GROUP = 'messaging.rocketmq.client_group'
441+
442+
# The unique identifier for each client
443+
MESSAGING_ROCKETMQ_CLIENT_ID = 'messaging.rocketmq.client_id'
444+
445+
# Type of message
446+
MESSAGING_ROCKETMQ_MESSAGE_TYPE = 'messaging.rocketmq.message_type'
447+
448+
# The secondary classifier of message besides topic
449+
MESSAGING_ROCKETMQ_MESSAGE_TAG = 'messaging.rocketmq.message_tag'
450+
451+
# Key(s) of message, another way to mark message besides message id
452+
MESSAGING_ROCKETMQ_MESSAGE_KEYS = 'messaging.rocketmq.message_keys'
453+
454+
# Model of message consumption. This only applies to consumer spans
455+
MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = 'messaging.rocketmq.consumption_model'
456+
397457
# The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request
398458
RPC_GRPC_STATUS_CODE = 'rpc.grpc.status_code'
399459

@@ -409,6 +469,19 @@ module Trace
409469
# `error.message` property of response if it is an error response
410470
RPC_JSONRPC_ERROR_MESSAGE = 'rpc.jsonrpc.error_message'
411471

472+
# Whether this is a received or sent message
473+
MESSAGE_TYPE = 'message.type'
474+
475+
# MUST be calculated as two different counters starting from `1` one for sent messages and one for received message
476+
# @note This way we guarantee that the values will be consistent between different implementations
477+
MESSAGE_ID = 'message.id'
478+
479+
# Compressed size of the message in bytes
480+
MESSAGE_COMPRESSED_SIZE = 'message.compressed_size'
481+
482+
# Uncompressed size of the message in bytes
483+
MESSAGE_UNCOMPRESSED_SIZE = 'message.uncompressed_size'
484+
412485
end
413486
end
414487
end

semantic_conventions/lib/opentelemetry/semantic_conventions/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
module OpenTelemetry
88
module SemanticConventions
9-
VERSION = '1.8.0'
9+
VERSION = '1.10.0'
1010
end
1111
end

0 commit comments

Comments
 (0)