Skip to content

Commit 3f7b7d0

Browse files
authored
Adopt attribute requirement levels in semantic conventions (open-telemetry#2594)
1 parent 48b522e commit 3f7b7d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+500
-488
lines changed

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"MD040": false,
1111
},
1212
"yaml.schemas": {
13-
"https://raw.githubusercontent.com/open-telemetry/build-tools/v0.11.0/semantic-conventions/semconv.schema.json": [
13+
"https://raw.githubusercontent.com/open-telemetry/build-tools/v0.12.0/semantic-conventions/semconv.schema.json": [
1414
"semantic_conventions/**/*.yaml"
1515
]
1616
},

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ MISSPELL = $(TOOLS_DIR)/$(MISSPELL_BINARY)
88

99
# see https://github.com/open-telemetry/build-tools/releases for semconvgen updates
1010
# Keep links in semantic_conventions/README.md and .vscode/settings.json in sync!
11-
SEMCONVGEN_VERSION=0.11.0
11+
SEMCONVGEN_VERSION=0.12.0
1212

1313
# TODO: add `yamllint` step to `all` after making sure it works on Mac.
1414
.PHONY: all

internal/tools/schema_check.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
set -e
88

9-
BUILD_TOOL_SCHEMAS_VERSION=0.11.0
9+
BUILD_TOOL_SCHEMAS_VERSION=0.12.0
1010

1111
# List of vesions that do not require or have a schema.
1212
declare -a skip_versions=("1.0.0" "1.0.1" "1.1.0" "1.2.0" "1.3.0" "1.6.0")

semantic_conventions/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ i.e.:
1717
Semantic conventions for the spec MUST adhere to the
1818
[attribute naming](../specification/common/attribute-naming.md) and [requirement level](../specification/common/attribute-requirement-level.md) conventions.
1919

20-
Refer to the [syntax](https://github.com/open-telemetry/build-tools/tree/v0.11.0/semantic-conventions/syntax.md)
20+
Refer to the [syntax](https://github.com/open-telemetry/build-tools/tree/v0.12.0/semantic-conventions/syntax.md)
2121
for how to write the YAML files for semantic conventions and what the YAML properties mean.
2222

2323
A schema file for VS code is configured in the `/.vscode/settings.json` of this
2424
repository, enabling auto-completion and additional checks. Refer to
25-
[the generator README](https://github.com/open-telemetry/build-tools/tree/v0.11.0/semantic-conventions/README.md) for what extension you need.
25+
[the generator README](https://github.com/open-telemetry/build-tools/tree/v0.12.0/semantic-conventions/README.md) for what extension you need.
2626

2727
## Generating markdown
2828

@@ -33,7 +33,7 @@ formatted Markdown tables for all semantic conventions in the specification. Run
3333
make table-generation
3434
```
3535

36-
For more information, see the [semantic convention generator](https://github.com/open-telemetry/build-tools/tree/v0.11.0/semantic-conventions)
36+
For more information, see the [semantic convention generator](https://github.com/open-telemetry/build-tools/tree/v0.12.0/semantic-conventions)
3737
in the OpenTelemetry build tools repository.
3838
Using this build tool, it is also possible to generate code for use in OpenTelemetry
3939
language projects.

semantic_conventions/resource/faas.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ groups:
66
attributes:
77
- id: name
88
type: string
9-
required: always
9+
requirement_level: required
1010
brief: >
1111
The name of the single function that this runtime instance executes.
1212
note: |

semantic_conventions/resource/os.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ groups:
4444
- id: z_os
4545
value: 'z_os'
4646
brief: "IBM z/OS"
47-
required: always
47+
requirement_level: required
4848
brief: 'The operating system type.'
4949
- id: description
5050
type: string

semantic_conventions/resource/process.yaml

+18-10
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,35 @@ groups:
1111
examples: [1234]
1212
- id: executable.name
1313
type: string
14-
required:
15-
conditional: "See below"
14+
requirement_level:
15+
conditionally_required: See alternative attributes below.
1616
brief: >
1717
The name of the process executable. On Linux based systems, can be set
1818
to the `Name` in `proc/[pid]/status`. On Windows, can be set to the
1919
base name of `GetProcessImageFileNameW`.
2020
examples: ['otelcol']
2121
- id: executable.path
2222
type: string
23-
required:
24-
conditional: "See below"
23+
requirement_level:
24+
conditionally_required: See alternative attributes below.
2525
brief: >
2626
The full path to the process executable. On Linux based systems, can
2727
be set to the target of `proc/[pid]/exe`. On Windows, can be set to the
2828
result of `GetProcessImageFileNameW`.
2929
examples: ['/usr/bin/cmd/otelcol']
3030
- id: command
3131
type: string
32-
required:
33-
conditional: "See below"
32+
requirement_level:
33+
conditionally_required: See alternative attributes below.
3434
brief: >
3535
The command used to launch the process (i.e. the command name). On Linux
3636
based systems, can be set to the zeroth string in `proc/[pid]/cmdline`.
3737
On Windows, can be set to the first parameter extracted from `GetCommandLineW`.
3838
examples: ['cmd/otelcol']
3939
- id: command_line
4040
type: string
41-
required:
42-
conditional: "See below"
41+
requirement_level:
42+
conditionally_required: See alternative attributes below.
4343
brief: >
4444
The full command used to launch the process as a single string representing
4545
the full command. On Windows, can be set to the result of `GetCommandLineW`.
@@ -48,8 +48,8 @@ groups:
4848
examples: ['C:\cmd\otecol --config="my directory\config.yaml"']
4949
- id: command_args
5050
type: string[]
51-
required:
52-
conditional: "See below"
51+
requirement_level:
52+
conditionally_required: See alternative attributes below.
5353
brief: >
5454
All the command arguments (including the command/executable itself) as
5555
received by the process. On Linux-based systems (and some other Unixoid
@@ -62,6 +62,14 @@ groups:
6262
brief: >
6363
The username of the user that owns the process.
6464
examples: 'root'
65+
constraints:
66+
- any_of:
67+
- process.executable.name
68+
- process.executable.path
69+
- process.command
70+
- process.command_line
71+
- process.command_args
72+
6573
- id: process.runtime
6674
prefix: process.runtime
6775
brief: >

semantic_conventions/resource/service.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ groups:
66
attributes:
77
- id: name
88
type: string
9-
required: always
9+
requirement_level: required
1010
brief: >
1111
Logical name of the service.
1212
note: >

semantic_conventions/resource/webengine.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ groups:
66
attributes:
77
- id: name
88
type: string
9-
required: always
9+
requirement_level: required
1010
brief: >
1111
The name of the web engine.
1212
examples: ['WildFly']

semantic_conventions/trace/cloudevents.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ groups:
88
attributes:
99
- id: event_id
1010
type: string
11-
required: always
11+
requirement_level: required
1212
brief: >
1313
The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event.
1414
examples: ['123e4567-e89b-12d3-a456-426614174000', '0001']
1515
- id: event_source
1616
type: string
17-
required: always
17+
requirement_level: required
1818
brief: >
1919
The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened.
2020
examples: ['https://github.com/cloudevents', '/cloudevents/spec/pull/123', 'my-service' ]
2121
- id: event_spec_version
2222
type: string
23-
required: always
23+
requirement_level: required
2424
brief: >
2525
The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses.
2626
examples: '1.0'
2727
- id: event_type
2828
type: string
29-
required: always
29+
requirement_level: required
3030
brief: >
3131
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.
3232
examples: ['com.github.pull_request.opened', 'com.example.object.deleted.v2']

semantic_conventions/trace/database.yaml

+21-23
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ groups:
88
- id: system
99
tag: connection-level
1010
brief: An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers.
11-
required: always
11+
requirement_level: required
1212
type:
1313
allow_custom_values: true
1414
members:
@@ -175,8 +175,8 @@ groups:
175175
- id: name
176176
tag: call-level
177177
type: string
178-
required:
179-
conditional: Required, if applicable.
178+
requirement_level:
179+
conditionally_required: If applicable.
180180
brief: >
181181
This attribute is used to report the name of the database being accessed.
182182
For commands that switch the database, this should be set to the target database
@@ -190,18 +190,18 @@ groups:
190190
- id: statement
191191
tag: call-level
192192
type: string
193-
required:
194-
conditional: >
195-
Required if applicable and not explicitly disabled via instrumentation configuration.
193+
requirement_level:
194+
conditionally_required: >
195+
If applicable and not explicitly disabled via instrumentation configuration.
196196
brief: >
197197
The database statement being executed.
198198
note: The value may be sanitized to exclude sensitive information.
199199
examples: ['SELECT * FROM wuser_table', 'SET mykey "WuValue"']
200200
- id: operation
201201
tag: call-level
202202
type: string
203-
required:
204-
conditional: Required, if `db.statement` is not applicable.
203+
requirement_level:
204+
conditionally_required: If `db.statement` is not applicable.
205205
brief: >
206206
The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations)
207207
such as `findAndModify`, or the SQL keyword.
@@ -215,20 +215,20 @@ groups:
215215
examples: ['findAndModify', 'HMSET', 'SELECT']
216216
- ref: net.peer.name
217217
tag: connection-level
218-
required:
219-
conditional: See below.
218+
requirement_level:
219+
conditionally_required: See alternative attributes below.
220220
- ref: net.peer.ip
221221
tag: connection-level
222-
required:
223-
conditional: See below.
222+
requirement_level:
223+
conditionally_required: See alternative attributes below.
224224
- ref: net.peer.port
225225
tag: connection-level
226-
required:
227-
conditional: Required if using a port other than the default port for this DBMS.
226+
requirement_level:
227+
conditionally_required: If using a port other than the default port for this DBMS.
228228
- ref: net.transport
229229
tag: connection-level
230-
required:
231-
conditional: Recommended in general, required for in-process databases (`"inproc"`).
230+
requirement_level:
231+
conditionally_required: If database type is in-process (`"inproc"`), recommended for other database types.
232232
constraints:
233233
- any_of:
234234
- 'net.peer.name'
@@ -294,8 +294,7 @@ groups:
294294
- id: table
295295
type: string
296296
tag: call-level-tech-specific-cassandra
297-
required:
298-
conditional: Recommended if available.
297+
requirement_level: recommended
299298
brief: The name of the primary table that the operation is acting upon, including the keyspace name (if applicable).
300299
note: >
301300
This mirrors the db.sql.table attribute but references cassandra rather than sql.
@@ -337,8 +336,8 @@ groups:
337336
attributes:
338337
- id: database_index
339338
type: int
340-
required:
341-
conditional: Required, if other than the default database (`0`).
339+
requirement_level:
340+
conditionally_required: If other than the default database (`0`).
342341
tag: call-level-tech-specific
343342
brief: >
344343
The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer.
@@ -353,7 +352,7 @@ groups:
353352
attributes:
354353
- id: collection
355354
type: string
356-
required: always
355+
requirement_level: required
357356
tag: call-level-tech-specific
358357
brief: >
359358
The collection being accessed within the database stated in `db.name`.
@@ -368,8 +367,7 @@ groups:
368367
- id: table
369368
tag: call-level-tech-specific
370369
type: string
371-
required:
372-
conditional: Recommended if available.
370+
requirement_level: recommended
373371
brief: The name of the primary table that the operation is acting upon, including the database name (if applicable).
374372
note: >
375373
It is not recommended to attempt any client-side parsing of

semantic_conventions/trace/faas.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ groups:
5050
attributes:
5151
- id: collection
5252
type: string
53-
required: always
53+
requirement_level: required
5454
brief: >
5555
The name of the source on which the triggering operation was performed.
5656
For example, in Cloud Storage or S3 corresponds to the bucket name,
5757
and in Cosmos DB to the database name.
5858
examples: ['myBucketName', 'myDbName']
5959
- id: operation
60-
required: always
60+
requirement_level: required
6161
type:
6262
allow_custom_values: true
6363
members:
@@ -73,7 +73,7 @@ groups:
7373
brief: 'Describes the type of the operation that was performed on the data.'
7474
- id: time
7575
type: string
76-
required: always
76+
requirement_level: required
7777
brief: >
7878
A string containing the time when the data was accessed in the
7979
[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)
@@ -111,7 +111,7 @@ groups:
111111
attributes:
112112
- id: time
113113
type: string
114-
required: always
114+
requirement_level: required
115115
brief: >
116116
A string containing the function invocation time in the
117117
[ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html)
@@ -137,7 +137,7 @@ groups:
137137
A boolean that is true if the serverless function is executed for the
138138
first time (aka cold-start).
139139
- ref: faas.trigger
140-
required: always
140+
requirement_level: required
141141

142142
- id: faas_span.out
143143
extends: faas_span
@@ -148,7 +148,7 @@ groups:
148148
attributes:
149149
- id: invoked_name
150150
type: string
151-
required: always
151+
requirement_level: required
152152
brief: >
153153
The name of the invoked function.
154154
note: >
@@ -174,16 +174,16 @@ groups:
174174
- id: 'tencent_cloud'
175175
value: 'tencent_cloud'
176176
brief: 'Tencent Cloud'
177-
required: always
177+
requirement_level: required
178178
brief: >
179179
The cloud provider of the invoked function.
180180
note: >
181181
SHOULD be equal to the `cloud.provider` resource attribute of the
182182
invoked function.
183183
- id: invoked_region
184184
type: string
185-
required:
186-
conditional: >
185+
requirement_level:
186+
conditionally_required: >
187187
For some cloud providers, like AWS or GCP, the region in which a
188188
function is hosted is essential to uniquely identify the function
189189
and also part of its endpoint. Since it's part of the endpoint

0 commit comments

Comments
 (0)