From fe157efee65725c2b4ce2e786994af951f4470bf Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 6 Mar 2024 10:26:46 -0800 Subject: [PATCH] Adds required stability property to enum members (#267) Co-authored-by: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> --- semantic-conventions/CHANGELOG.md | 2 + semantic-conventions/README.md | 9 +- semantic-conventions/semconv.schema.json | 14 +++ .../semconv/model/semantic_attribute.py | 29 ++++- .../semconv/templating/compatibility.py | 114 +++++++++++------- .../semconv/templating/markdown/__init__.py | 33 ++--- .../compat/enum_member_removed/vnext.yaml | 3 +- .../compat/enum_member_removed/vprev.yaml | 3 +- .../data/compat/enum_type_changed/vnext.yaml | 14 ++- .../data/compat/enum_type_changed/vprev.yaml | 14 ++- .../data/compat/enum_value_changed/vnext.yaml | 5 + .../data/compat/enum_value_changed/vprev.yaml | 5 + .../src/tests/data/compat/success/vnext.yaml | 4 +- .../src/tests/data/compat/success/vprev.yaml | 2 + .../data/markdown/deprecated/general.yaml | 7 ++ .../tests/data/markdown/deprecated/http.yaml | 5 + .../tests/data/markdown/empty/general.yaml | 7 ++ .../tests/data/markdown/empty_table/faas.yaml | 5 + .../data/markdown/empty_table/general.yaml | 7 ++ .../src/tests/data/markdown/enum_int/rpc.yaml | 17 +++ .../markdown/extend_constraint/database.yaml | 43 +++++++ .../markdown/extend_constraint/general.yaml | 7 ++ .../src/tests/data/markdown/include/faas.yaml | 5 + .../data/markdown/multiple_enum/general.yaml | 13 ++ .../data/markdown/parameter_empty/faas.yaml | 5 + .../data/markdown/parameter_full/faas.yaml | 5 + .../parameter_remove_constraint/database.yaml | 40 ++++++ .../data/markdown/parameter_tag/database.yaml | 40 ++++++ .../parameter_tag_empty/database.yaml | 40 ++++++ .../markdown/stability/all_badges_expected.md | 21 ++++ .../data/markdown/stability/stability.yaml | 26 +++- .../stability/stable_badges_expected.md | 21 ++++ .../src/tests/data/yaml/cloud.yaml | 3 + .../yaml/errors/empty/empty_example_enum.yaml | 1 + .../experimental_attr_stable_member.yaml | 14 +++ .../missing_stability_on_enum_member.yaml | 13 ++ ...tiple_stability_values_on_enum_member.yaml | 14 +++ ..._value.yaml => wrong_stability_value.yaml} | 0 .../wrong_stability_value_on_enum_member.yaml | 14 +++ .../src/tests/data/yaml/faas.yaml | 8 ++ .../src/tests/data/yaml/general.yaml | 7 ++ .../src/tests/data/yaml/http.yaml | 5 + .../semconv/model/test_error_detection.py | 42 ++++++- .../semconv/templating/test_compatibility.py | 5 + semantic-conventions/syntax.md | 4 +- 45 files changed, 629 insertions(+), 66 deletions(-) create mode 100644 semantic-conventions/src/tests/data/yaml/errors/stability/experimental_attr_stable_member.yaml create mode 100644 semantic-conventions/src/tests/data/yaml/errors/stability/missing_stability_on_enum_member.yaml create mode 100644 semantic-conventions/src/tests/data/yaml/errors/stability/multiple_stability_values_on_enum_member.yaml rename semantic-conventions/src/tests/data/yaml/errors/stability/{wrong_value.yaml => wrong_stability_value.yaml} (100%) create mode 100644 semantic-conventions/src/tests/data/yaml/errors/stability/wrong_stability_value_on_enum_member.yaml diff --git a/semantic-conventions/CHANGELOG.md b/semantic-conventions/CHANGELOG.md index 38501e04..786f0f40 100644 --- a/semantic-conventions/CHANGELOG.md +++ b/semantic-conventions/CHANGELOG.md @@ -4,6 +4,8 @@ Please update the changelog as part of any significant pull request. ## Unreleased +- BREAKING: Add `stability` (required) and `deprecated` (optional) properties to `EnumMember` + ([#267](https://github.com/open-telemetry/build-tools/pull/267)) - Change minimum support python version to 3.10 in setup.cfg and Dockerfile ([#285](https://github.com/open-telemetry/build-tools/pull/285)) - BREAKING: Make stability required (also: fix ref and extends, render badges on metrics). diff --git a/semantic-conventions/README.md b/semantic-conventions/README.md index e76f01d2..e52a12a2 100644 --- a/semantic-conventions/README.md +++ b/semantic-conventions/README.md @@ -133,13 +133,18 @@ The `{semconv version}` (e.g. `1.24.0`) is the previously released version of se Following checks are performed - On all attributes and metrics (experimental and stable): - - attributes and metrics must not be removed. + - attributes and metrics must not be removed + - enum attribute members must not be removed - On stable attributes and attribute templates: - stability must not be changed - the type of attribute must not be changed - enum attribute: type of value must not be changed - - enum attribute: members must not be removed (changing `id` field is allowed, as long as `value` does not change) + +- On stable enum attribute members: + - stability must not be changed + - `id` and `value` must not be changed + - On stable metrics: - stability must not be changed - instrument and unit must not be changed diff --git a/semantic-conventions/semconv.schema.json b/semantic-conventions/semconv.schema.json index 7e51cca3..0e3a5050 100644 --- a/semantic-conventions/semconv.schema.json +++ b/semantic-conventions/semconv.schema.json @@ -259,6 +259,9 @@ "note": { "type": "string", "description": "longer description. It defaults to an empty string." + }, + "stability": { + "allOf": [{ "$ref": "#/definitions/StabilityLevel" }] } } } @@ -343,6 +346,14 @@ } ] }, + "StabilityLevel": { + "description": "specifies the stability level. Can be 'stable' or 'experimental' (the default).", + "type": "string", + "enum": [ + "stable", + "experimental" + ] + }, "Attribute": { "type": "object", "allOf": [ @@ -416,6 +427,9 @@ "deprecated": { "type": "string", "description": "specifies if the attribute is deprecated. The string provided as MUST specify why it's deprecated and/or what to use instead." + }, + "stability": { + "allOf": [{ "$ref": "#/definitions/StabilityLevel" }] } } }, diff --git a/semantic-conventions/src/opentelemetry/semconv/model/semantic_attribute.py b/semantic-conventions/src/opentelemetry/semconv/model/semantic_attribute.py index 5d1c1b49..32996f9d 100644 --- a/semantic-conventions/src/opentelemetry/semconv/model/semantic_attribute.py +++ b/semantic-conventions/src/opentelemetry/semconv/model/semantic_attribute.py @@ -187,6 +187,17 @@ def parse( stability = SemanticAttribute.parse_stability( attribute.get("stability"), position_data, strict_validation ) + if stability == StabilityLevel.EXPERIMENTAL and isinstance( + attr_type, EnumAttributeType + ): + for member in attr_type.members: + if member.stability == StabilityLevel.STABLE: + msg = ( + f"Member '{member.member_id}' is marked as stable " + + "but it is not allowed on experimental attribute!" + ) + raise ValidationError.from_yaml_pos(position_data["type"], msg) + deprecated = SemanticAttribute.parse_deprecated( attribute.get("deprecated"), position_data ) @@ -482,7 +493,7 @@ def parse(attribute_type): attribute_type.lc.data["members"], "Enumeration without members!" ) - allowed_keys = ["id", "value", "brief", "note"] + allowed_keys = ["id", "value", "brief", "note", "stability", "deprecated"] mandatory_keys = ["id", "value"] for member in attribute_type["members"]: validate_values(member, allowed_keys, mandatory_keys) @@ -492,12 +503,26 @@ def parse(attribute_type): f"Invalid value used in enum: <{member['value']}>", ) validate_id(member["id"], member.lc.data["id"]) + + stability_str = member.get("stability") + if not stability_str: + raise ValidationError.from_yaml_pos( + member.lc.data["id"], + f"Enumeration member '{member['value']}' must have a stability level", + ) + + stability = SemanticAttribute.parse_stability(stability_str, member.lc.data) + deprecated = SemanticAttribute.parse_deprecated( + member.get("deprecated"), member.lc.data + ) members.append( EnumMember( member_id=member["id"], value=member["value"], brief=member.get("brief", member["id"]).strip(), note=member.get("note", "").strip(), + stability=stability, + deprecated=deprecated, ) ) enum_type = AttributeType.get_type(members[0].value) @@ -516,6 +541,8 @@ class EnumMember: value: str brief: str note: str + stability: StabilityLevel + deprecated: str class MdLink: diff --git a/semantic-conventions/src/opentelemetry/semconv/templating/compatibility.py b/semantic-conventions/src/opentelemetry/semconv/templating/compatibility.py index 0a28366f..03d94da8 100644 --- a/semantic-conventions/src/opentelemetry/semconv/templating/compatibility.py +++ b/semantic-conventions/src/opentelemetry/semconv/templating/compatibility.py @@ -67,49 +67,66 @@ def _check_attribute(self, prev: SemanticAttribute, problems: list[Problem]): problems.append(Problem("attribute", prev.fqn, "was removed")) return + self._check_stability( + prev.stability, cur.stability, "attribute", prev.fqn, problems + ) if prev.stability == StabilityLevel.STABLE: - if cur.stability != prev.stability: + self._check_attribute_type(prev, cur, problems) + + if ( + isinstance(prev.attr_type, EnumAttributeType) + and + # this makes mypy happy, we already checked that type is the same for stable attributes + isinstance(cur.attr_type, EnumAttributeType) + ): + for member in prev.attr_type.members: + self._check_member(prev.fqn, member, cur.attr_type.members, problems) + + def _check_stability( + self, + prev: StabilityLevel, + cur: StabilityLevel, + signal: str, + fqn: str, + problems: list[Problem], + ): + if prev == StabilityLevel.STABLE and cur != prev: + problems.append( + Problem(signal, fqn, f"stability changed from '{prev}' to '{cur}'") + ) + + def _check_attribute_type( + self, prev: SemanticAttribute, cur: SemanticAttribute, problems: list[Problem] + ): + if isinstance(prev.attr_type, EnumAttributeType): + if not isinstance(cur.attr_type, EnumAttributeType): problems.append( Problem( "attribute", prev.fqn, - f"stability changed from '{prev.stability}' to '{cur.stability}'", + f"type changed from '{prev.attr_type}' to '{cur.attr_type}'", ) ) - - if isinstance(prev.attr_type, EnumAttributeType): - if not isinstance(cur.attr_type, EnumAttributeType): + else: + # enum type change inevitably causes some values to be removed + # which will be reported in _check_member method as well. + # keeping this check to provide more detailed error message + if cur.attr_type.enum_type != prev.attr_type.enum_type: problems.append( Problem( "attribute", prev.fqn, - f"type changed from '{prev.attr_type}' to '{cur.attr_type}'", + f"enum type changed from '{prev.attr_type.enum_type}' to '{cur.attr_type.enum_type}'", ) ) - else: - # enum type change inevitably causes some values to be removed - # which will be reported in _check_member method as well. - # keeping this check to provide more detailed error message - if cur.attr_type.enum_type != prev.attr_type.enum_type: - problems.append( - Problem( - "attribute", - prev.fqn, - f"enum type changed from '{prev.attr_type.enum_type}' to '{cur.attr_type.enum_type}'", - ) - ) - for member in prev.attr_type.members: - self._check_member( - prev.fqn, member, cur.attr_type.members, problems - ) - elif cur.attr_type != prev.attr_type: - problems.append( - Problem( - "attribute", - prev.fqn, - f"type changed from '{prev.attr_type}' to '{cur.attr_type}'", - ) + elif cur.attr_type != prev.attr_type: + problems.append( + Problem( + "attribute", + prev.fqn, + f"type changed from '{prev.attr_type}' to '{cur.attr_type}'", ) + ) def _check_member( self, @@ -118,8 +135,22 @@ def _check_member( members: list[EnumMember], problems: list[Problem], ): + found = False for member in members: if prev.member_id == member.member_id: + found = True + if prev.stability != StabilityLevel.STABLE: + # we allow stability and value changes for non-stable members + break + + self._check_stability( + prev.stability, + member.stability, + "enum attribute member", + f"{fqn}.{prev.member_id}", + problems, + ) + if prev.value != member.value: member_value = ( f'"{member.value}"' @@ -133,10 +164,12 @@ def _check_member( f"value changed from '{prev.value}' to '{member_value}'", ) ) - return - problems.append( - Problem("enum attribute member", f"{fqn}.{prev.member_id}", "was removed") - ) + if not found: + problems.append( + Problem( + "enum attribute member", f"{fqn}.{prev.member_id}", "was removed" + ) + ) def _check_metric(self, prev: MetricSemanticConvention, problems: list[Problem]): for cur in self.current_semconv.models.values(): @@ -145,14 +178,13 @@ def _check_metric(self, prev: MetricSemanticConvention, problems: list[Problem]) and cur.metric_name == prev.metric_name ): if prev.stability == StabilityLevel.STABLE: - if cur.stability != prev.stability: - problems.append( - Problem( - "metric", - prev.metric_name, - f"stability changed from '{prev.stability}' to '{cur.stability}'", - ) - ) + self._check_stability( + prev.stability, + cur.stability, + "metric", + prev.metric_name, + problems, + ) if cur.unit != prev.unit: problems.append( Problem( diff --git a/semantic-conventions/src/opentelemetry/semconv/templating/markdown/__init__.py b/semantic-conventions/src/opentelemetry/semconv/templating/markdown/__init__.py index 2413d197..4accf983 100644 --- a/semantic-conventions/src/opentelemetry/semconv/templating/markdown/__init__.py +++ b/semantic-conventions/src/opentelemetry/semconv/templating/markdown/__init__.py @@ -126,7 +126,10 @@ def to_markdown_attr( if isinstance(attribute.attr_type, EnumAttributeType) else AttributeType.get_instantiated_type(attribute.attr_type) ) - description = self._description_with_badge(attribute) + attribute.brief + description = ( + self._description_with_badge(attribute.stability, attribute.deprecated) + + attribute.brief + ) if attribute.note: self.render_ctx.add_note(attribute.note) description += f" [{len(self.render_ctx.notes)}]" @@ -242,7 +245,10 @@ def to_markdown_metric_table( "| -------- | --------------- | ----------- | -------------- |\n" ) - description = self._description_with_badge(semconv) + semconv.brief + description = ( + self._description_with_badge(semconv.stability, semconv.deprecated) + + semconv.brief + ) if semconv.note: self.render_ctx.add_note(semconv.note) description += f" [{len(self.render_ctx.notes)}]" @@ -327,7 +333,10 @@ def to_markdown_enum(self, output: io.StringIO): counter = 1 notes = [] for member in enum.members: - description = member.brief + description = ( + self._description_with_badge(member.stability, member.deprecated) + + member.brief + ) if member.note: description += f" [{counter}]" counter += 1 @@ -528,22 +537,18 @@ def _render_group(self, semconv, parameters, output): output.write("") - def _description_with_badge( - self, item: typing.Union[SemanticAttribute | BaseSemanticConvention] - ): + def _description_with_badge(self, stability: StabilityLevel, deprecated: str): description = "" - if item.deprecated and self.options.enable_deprecated: - if "deprecated" in item.deprecated.lower(): - description = f"**{item.deprecated}**
" + if deprecated and self.options.enable_deprecated: + if "deprecated" in deprecated.lower(): + description = f"**{deprecated}**
" else: - deprecated_msg = self.options.deprecated_md_snippet().format( - item.deprecated - ) + deprecated_msg = self.options.deprecated_md_snippet().format(deprecated) description = f"{deprecated_msg}
" - elif item.stability == StabilityLevel.STABLE and self.options.enable_stable: + elif stability == StabilityLevel.STABLE and self.options.enable_stable: description = f"{self.options.stable_md_snippet()}
" elif ( - item.stability == StabilityLevel.EXPERIMENTAL + stability == StabilityLevel.EXPERIMENTAL and self.options.enable_experimental ): description = f"{self.options.experimental_md_snippet()}
" diff --git a/semantic-conventions/src/tests/data/compat/enum_member_removed/vnext.yaml b/semantic-conventions/src/tests/data/compat/enum_member_removed/vnext.yaml index 9098298c..2c6eb19d 100644 --- a/semantic-conventions/src/tests/data/compat/enum_member_removed/vnext.yaml +++ b/semantic-conventions/src/tests/data/compat/enum_member_removed/vnext.yaml @@ -10,8 +10,9 @@ groups: members: - id: enum_two brief: "enum two" + stability: experimental value: "two" brief: "third attribute" note: "third attribute note" examples: ["two"] - stability: stable \ No newline at end of file + stability: experimental \ No newline at end of file diff --git a/semantic-conventions/src/tests/data/compat/enum_member_removed/vprev.yaml b/semantic-conventions/src/tests/data/compat/enum_member_removed/vprev.yaml index ab72dfa0..9ec933d4 100644 --- a/semantic-conventions/src/tests/data/compat/enum_member_removed/vprev.yaml +++ b/semantic-conventions/src/tests/data/compat/enum_member_removed/vprev.yaml @@ -10,8 +10,9 @@ groups: members: - id: enum_one brief: "enum one" + stability: experimental value: "one" brief: "third attribute" note: "third attribute note" examples: ["one"] - stability: stable \ No newline at end of file + stability: experimental \ No newline at end of file diff --git a/semantic-conventions/src/tests/data/compat/enum_type_changed/vnext.yaml b/semantic-conventions/src/tests/data/compat/enum_type_changed/vnext.yaml index 6875fb50..362cfa36 100644 --- a/semantic-conventions/src/tests/data/compat/enum_type_changed/vnext.yaml +++ b/semantic-conventions/src/tests/data/compat/enum_type_changed/vnext.yaml @@ -10,8 +10,20 @@ groups: members: - id: enum_one brief: "enum one" + stability: stable value: 1 brief: "third attribute" note: "third attribute note" - examples: [1] + examples: [3] + stability: stable + - id: forth_attr + type: + members: + - id: enum_two + brief: "enum two" + stability: experimental + value: 2 + brief: "forth attribute" + note: "forth attribute note" + examples: [2] stability: stable \ No newline at end of file diff --git a/semantic-conventions/src/tests/data/compat/enum_type_changed/vprev.yaml b/semantic-conventions/src/tests/data/compat/enum_type_changed/vprev.yaml index ab72dfa0..61a24607 100644 --- a/semantic-conventions/src/tests/data/compat/enum_type_changed/vprev.yaml +++ b/semantic-conventions/src/tests/data/compat/enum_type_changed/vprev.yaml @@ -10,8 +10,20 @@ groups: members: - id: enum_one brief: "enum one" + stability: stable value: "one" brief: "third attribute" note: "third attribute note" - examples: ["one"] + examples: ["three"] + stability: stable + - id: forth_attr + type: + members: + - id: enum_two + brief: "enum two" + stability: experimental + value: "one" + brief: "forth attribute" + note: "forth attribute note" + examples: ["four"] stability: stable \ No newline at end of file diff --git a/semantic-conventions/src/tests/data/compat/enum_value_changed/vnext.yaml b/semantic-conventions/src/tests/data/compat/enum_value_changed/vnext.yaml index 88f07223..c04605b5 100644 --- a/semantic-conventions/src/tests/data/compat/enum_value_changed/vnext.yaml +++ b/semantic-conventions/src/tests/data/compat/enum_value_changed/vnext.yaml @@ -10,7 +10,12 @@ groups: members: - id: enum_one brief: "enum one" + stability: stable value: "1" + - id: enum_two + brief: "enum two" + stability: experimental + value: "_two_" brief: "third attribute" note: "third attribute note" examples: ["one"] diff --git a/semantic-conventions/src/tests/data/compat/enum_value_changed/vprev.yaml b/semantic-conventions/src/tests/data/compat/enum_value_changed/vprev.yaml index ab72dfa0..b6bd3281 100644 --- a/semantic-conventions/src/tests/data/compat/enum_value_changed/vprev.yaml +++ b/semantic-conventions/src/tests/data/compat/enum_value_changed/vprev.yaml @@ -10,7 +10,12 @@ groups: members: - id: enum_one brief: "enum one" + stability: stable value: "one" + - id: enum_two + brief: "enum two" + stability: experimental + value: "two" brief: "third attribute" note: "third attribute note" examples: ["one"] diff --git a/semantic-conventions/src/tests/data/compat/success/vnext.yaml b/semantic-conventions/src/tests/data/compat/success/vnext.yaml index 388e6efc..1b762111 100644 --- a/semantic-conventions/src/tests/data/compat/success/vnext.yaml +++ b/semantic-conventions/src/tests/data/compat/success/vnext.yaml @@ -22,9 +22,11 @@ groups: members: - id: enum_one brief: "Enum one." - value: "one" + stability: stable + value: "_one_" - id: enum_two brief: "Enum two." + stability: stable value: "two" brief: "Third attribute." note: "Third attribute note." diff --git a/semantic-conventions/src/tests/data/compat/success/vprev.yaml b/semantic-conventions/src/tests/data/compat/success/vprev.yaml index 0c3ca727..79fc8d1d 100644 --- a/semantic-conventions/src/tests/data/compat/success/vprev.yaml +++ b/semantic-conventions/src/tests/data/compat/success/vprev.yaml @@ -22,9 +22,11 @@ groups: members: - id: enum_one brief: "enum one" + stability: experimental value: "one" - id: enum_two brief: "enum two" + stability: stable value: "two" brief: "third attribute" note: "third attribute note" diff --git a/semantic-conventions/src/tests/data/markdown/deprecated/general.yaml b/semantic-conventions/src/tests/data/markdown/deprecated/general.yaml index 907fd00a..d0bc36ff 100644 --- a/semantic-conventions/src/tests/data/markdown/deprecated/general.yaml +++ b/semantic-conventions/src/tests/data/markdown/deprecated/general.yaml @@ -12,19 +12,25 @@ groups: members: - id: ip.tcp value: "IP.TCP" + stability: experimental - id: ip.udp value: "IP.UDP" + stability: experimental - id: ip value: "IP" + stability: experimental brief: 'Another IP-based protocol' - id: unix value: "Unix" + stability: experimental brief: 'Unix Domain socket. See below.' - id: pipe value: "pipe" + stability: experimental brief: 'Named or anonymous pipe. See note below.' - id: inproc value: "inproc" + stability: experimental brief: 'In-process communication.' note: > Signals that there is only in-process communication not using a "real" network protocol @@ -32,6 +38,7 @@ groups: attributes can be left out in that case. - id: other value: "other" + stability: experimental brief: 'Something else (non IP-based).' brief: > Transport protocol used. See note below. diff --git a/semantic-conventions/src/tests/data/markdown/deprecated/http.yaml b/semantic-conventions/src/tests/data/markdown/deprecated/http.yaml index 4f668d6d..e0061b1d 100644 --- a/semantic-conventions/src/tests/data/markdown/deprecated/http.yaml +++ b/semantic-conventions/src/tests/data/markdown/deprecated/http.yaml @@ -61,18 +61,23 @@ groups: - id: http_1_0 value: '1.0' brief: 'HTTP 1.0' + stability: experimental - id: http_1_1 value: '1.1' brief: 'HTTP 1.1' + stability: experimental - id: http_2_0 value: '2.0' brief: 'HTTP 2' + stability: experimental - id: spdy value: 'SPDY' brief: 'SPDY protocol.' + stability: experimental - id: quic value: 'QUIC' brief: 'QUIC protocol.' + stability: experimental brief: 'Kind of HTTP protocol used' deprecated: Deprecated. Use attribute `flavor_new` instead. note: > diff --git a/semantic-conventions/src/tests/data/markdown/empty/general.yaml b/semantic-conventions/src/tests/data/markdown/empty/general.yaml index 907fd00a..71ebd125 100644 --- a/semantic-conventions/src/tests/data/markdown/empty/general.yaml +++ b/semantic-conventions/src/tests/data/markdown/empty/general.yaml @@ -12,25 +12,32 @@ groups: members: - id: ip.tcp value: "IP.TCP" + stability: experimental - id: ip.udp value: "IP.UDP" + stability: experimental - id: ip value: "IP" brief: 'Another IP-based protocol' + stability: experimental - id: unix value: "Unix" brief: 'Unix Domain socket. See below.' + stability: experimental - id: pipe value: "pipe" brief: 'Named or anonymous pipe. See note below.' + stability: experimental - id: inproc value: "inproc" brief: 'In-process communication.' + stability: experimental note: > Signals that there is only in-process communication not using a "real" network protocol in cases where network attributes would normally be expected. Usually all other network attributes can be left out in that case. - id: other + stability: experimental value: "other" brief: 'Something else (non IP-based).' brief: > diff --git a/semantic-conventions/src/tests/data/markdown/empty_table/faas.yaml b/semantic-conventions/src/tests/data/markdown/empty_table/faas.yaml index 648eb26e..6e3ad387 100644 --- a/semantic-conventions/src/tests/data/markdown/empty_table/faas.yaml +++ b/semantic-conventions/src/tests/data/markdown/empty_table/faas.yaml @@ -17,17 +17,22 @@ groups: - id: datasource value: 'datasource' brief: 'A response to some data source operation such as a database or filesystem read/write.' + stability: experimental - id: http value: 'http' brief: 'To provide an answer to an inbound HTTP request' + stability: experimental - id: pubsub value: 'pubsub' brief: 'A function is set to be executed when messages are sent to a messaging system.' + stability: experimental - id: timer value: 'timer' brief: 'A function is scheduled to be executed regularly.' + stability: experimental - id: other value: 'other' + stability: experimental - id: execution stability: experimental type: string diff --git a/semantic-conventions/src/tests/data/markdown/empty_table/general.yaml b/semantic-conventions/src/tests/data/markdown/empty_table/general.yaml index 907fd00a..ba9318d2 100644 --- a/semantic-conventions/src/tests/data/markdown/empty_table/general.yaml +++ b/semantic-conventions/src/tests/data/markdown/empty_table/general.yaml @@ -12,20 +12,26 @@ groups: members: - id: ip.tcp value: "IP.TCP" + stability: experimental - id: ip.udp value: "IP.UDP" + stability: experimental - id: ip value: "IP" brief: 'Another IP-based protocol' + stability: experimental - id: unix value: "Unix" brief: 'Unix Domain socket. See below.' + stability: experimental - id: pipe value: "pipe" brief: 'Named or anonymous pipe. See note below.' + stability: experimental - id: inproc value: "inproc" brief: 'In-process communication.' + stability: experimental note: > Signals that there is only in-process communication not using a "real" network protocol in cases where network attributes would normally be expected. Usually all other network @@ -33,6 +39,7 @@ groups: - id: other value: "other" brief: 'Something else (non IP-based).' + stability: experimental brief: > Transport protocol used. See note below. examples: 'IP.TCP' diff --git a/semantic-conventions/src/tests/data/markdown/enum_int/rpc.yaml b/semantic-conventions/src/tests/data/markdown/enum_int/rpc.yaml index 1c13a243..0a34a892 100644 --- a/semantic-conventions/src/tests/data/markdown/enum_int/rpc.yaml +++ b/semantic-conventions/src/tests/data/markdown/enum_int/rpc.yaml @@ -10,38 +10,55 @@ groups: members: - id: ok value: 0 + stability: experimental - id: cancelled value: 1 + stability: experimental - id: unknown value: 2 + stability: experimental - id: invalid_argument value: 3 + stability: experimental - id: deadline_exceeded value: 4 + stability: experimental - id: not_found value: 5 + stability: experimental - id: already_exists value: 6 + stability: experimental - id: permission_denied value: 7 + stability: experimental - id: resource_exhausted value: 8 + stability: experimental - id: failed_precondition value: 9 + stability: experimental - id: aborted value: 10 + stability: experimental - id: out_of_range value: 11 + stability: experimental - id: unimplemented value: 12 + stability: experimental - id: internal value: 13 + stability: experimental - id: unavailable value: 14 + stability: experimental - id: data_loss value: 15 + stability: experimental - id: unauthenticated value: 16 + stability: experimental requirement_level: required brief: "The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request." examples: [0, 1, 16] diff --git a/semantic-conventions/src/tests/data/markdown/extend_constraint/database.yaml b/semantic-conventions/src/tests/data/markdown/extend_constraint/database.yaml index a64b6d85..ebfd1b70 100644 --- a/semantic-conventions/src/tests/data/markdown/extend_constraint/database.yaml +++ b/semantic-conventions/src/tests/data/markdown/extend_constraint/database.yaml @@ -18,132 +18,175 @@ groups: - id: other_sql value: 'other_sql' brief: 'Some other SQL database. Fallback only. See notes.' + stability: experimental - id: mssql value: 'mssql' brief: 'Microsoft SQL Server' + stability: experimental - id: mysql value: 'mysql' brief: 'MySQL' + stability: experimental - id: oracle value: 'oracle' brief: 'Oracle Database' + stability: experimental - id: db2 value: 'db2' brief: 'IBM Db2' + stability: experimental - id: postgresql value: 'postgresql' brief: 'PostgreSQL' + stability: experimental - id: redshift value: 'redshift' brief: 'Amazon Redshift' + stability: experimental - id: hive value: 'hive' brief: 'Apache Hive' + stability: experimental - id: cloudscape value: 'cloudscape' brief: 'Cloudscape' + stability: experimental - id: hsqlsb value: 'hsqlsb' brief: 'HyperSQL DataBase' + stability: experimental - id: progress value: 'progress' brief: 'Progress Database' + stability: experimental - id: maxdb value: 'maxdb' brief: 'SAP MaxDB' + stability: experimental - id: hanadb value: 'hanadb' brief: 'SAP HANA' + stability: experimental - id: ingres value: 'ingres' brief: 'Ingres' + stability: experimental - id: firstsql value: 'firstsql' brief: 'FirstSQL' + stability: experimental - id: edb value: 'edb' brief: 'EnterpriseDB' + stability: experimental - id: cache value: 'cache' brief: 'InterSystems Caché' + stability: experimental - id: adabas value: 'adabas' brief: 'Adabas (Adaptable Database System)' + stability: experimental - id: firebird value: 'firebird' brief: 'Firebird' + stability: experimental - id: derby value: 'derby' brief: 'Apache Derby' + stability: experimental - id: filemaker value: 'filemaker' brief: 'FileMaker' + stability: experimental - id: informix value: 'informix' brief: 'Informix' + stability: experimental - id: instantdb value: 'instantdb' brief: 'InstantDB' + stability: experimental - id: interbase value: 'interbase' brief: 'InterBase' + stability: experimental - id: mariadb value: 'mariadb' brief: 'MariaDB' + stability: experimental - id: netezza value: 'netezza' brief: 'Netezza' + stability: experimental - id: pervasive value: 'pervasive' brief: 'Pervasive PSQL' + stability: experimental - id: pointbase value: 'pointbase' brief: 'PointBase' + stability: experimental - id: sqlite value: 'sqlite' brief: 'SQLite' + stability: experimental - id: sybase value: 'sybase' brief: 'Sybase' + stability: experimental - id: teradata value: 'teradata' brief: 'Teradata' + stability: experimental - id: vertica value: 'vertica' brief: 'Vertica' + stability: experimental - id: h2 value: 'h2' brief: 'H2' + stability: experimental - id: coldfusion value: 'coldfusion' brief: 'ColdFusion IMQ' + stability: experimental - id: cassandra value: 'cassandra' brief: 'Apache Cassandra' + stability: experimental - id: hbase value: 'hbase' brief: 'Apache HBase' + stability: experimental - id: mongodb value: 'mongodb' brief: 'MongoDB' + stability: experimental - id: redis value: 'redis' brief: 'Redis' + stability: experimental - id: couchbase value: 'couchbase' brief: 'Couchbase' + stability: experimental - id: couchdb value: 'couchdb' brief: 'CouchDB' + stability: experimental - id: cosmosdb value: 'cosmosdb' brief: 'Microsoft Azure Cosmos DB' + stability: experimental - id: dynamodb value: 'dynamodb' brief: 'Amazon DynamoDB' + stability: experimental - id: neo4j value: 'neo4j' brief: 'Neo4j' + stability: experimental - id: connection_string stability: experimental tag: connection-level diff --git a/semantic-conventions/src/tests/data/markdown/extend_constraint/general.yaml b/semantic-conventions/src/tests/data/markdown/extend_constraint/general.yaml index 907fd00a..ba9318d2 100644 --- a/semantic-conventions/src/tests/data/markdown/extend_constraint/general.yaml +++ b/semantic-conventions/src/tests/data/markdown/extend_constraint/general.yaml @@ -12,20 +12,26 @@ groups: members: - id: ip.tcp value: "IP.TCP" + stability: experimental - id: ip.udp value: "IP.UDP" + stability: experimental - id: ip value: "IP" brief: 'Another IP-based protocol' + stability: experimental - id: unix value: "Unix" brief: 'Unix Domain socket. See below.' + stability: experimental - id: pipe value: "pipe" brief: 'Named or anonymous pipe. See note below.' + stability: experimental - id: inproc value: "inproc" brief: 'In-process communication.' + stability: experimental note: > Signals that there is only in-process communication not using a "real" network protocol in cases where network attributes would normally be expected. Usually all other network @@ -33,6 +39,7 @@ groups: - id: other value: "other" brief: 'Something else (non IP-based).' + stability: experimental brief: > Transport protocol used. See note below. examples: 'IP.TCP' diff --git a/semantic-conventions/src/tests/data/markdown/include/faas.yaml b/semantic-conventions/src/tests/data/markdown/include/faas.yaml index b9d592b1..84607bbe 100644 --- a/semantic-conventions/src/tests/data/markdown/include/faas.yaml +++ b/semantic-conventions/src/tests/data/markdown/include/faas.yaml @@ -15,18 +15,23 @@ groups: allow_custom_values: false members: - id: datasource + stability: experimental value: 'datasource' brief: 'A response to some data source operation such as a database or filesystem read/write.' - id: http + stability: experimental value: 'http' brief: 'To provide an answer to an inbound HTTP request' - id: pubsub + stability: experimental value: 'pubsub' brief: 'A function is set to be executed when messages are sent to a messaging system.' - id: timer + stability: experimental value: 'timer' brief: 'A function is scheduled to be executed regularly.' - id: other + stability: experimental value: 'other' - id: execution stability: experimental diff --git a/semantic-conventions/src/tests/data/markdown/multiple_enum/general.yaml b/semantic-conventions/src/tests/data/markdown/multiple_enum/general.yaml index 650de793..2edca218 100644 --- a/semantic-conventions/src/tests/data/markdown/multiple_enum/general.yaml +++ b/semantic-conventions/src/tests/data/markdown/multiple_enum/general.yaml @@ -12,26 +12,33 @@ groups: members: - id: ip.tcp value: "IP.TCP" + stability: experimental - id: ip.udp value: "IP.UDP" + stability: experimental - id: ip value: "IP" brief: 'Another IP-based protocol' + stability: experimental - id: unix value: "Unix" brief: 'Unix Domain socket. See below.' + stability: experimental - id: pipe value: "pipe" brief: 'Named or anonymous pipe. See note below.' + stability: experimental - id: inproc value: "inproc" brief: 'In-process communication.' + stability: experimental note: > Signals that there is only in-process communication not using a "real" network protocol in cases where network attributes would normally be expected. Usually all other network attributes can be left out in that case. - id: other value: "other" + stability: experimental brief: 'Something else (non IP-based).' brief: > Transport protocol used. See note below. @@ -43,13 +50,17 @@ groups: members: - id: wifi value: "wifi" + stability: experimental note: "Usually 802.11" - id: wired value: "wired" + stability: experimental - id: cell value: "cell" + stability: experimental - id: unavailable value: "unavailable" + stability: experimental brief: 'unavailable' examples: 'wifi' - id: host.connection.subtype @@ -61,10 +72,12 @@ groups: value: "1G" brief: > 1G + stability: experimental - id: gen2g value: "2G" brief: > 2G + stability: experimental brief: 'This describes more details regarding the connection.type. It may be the type of cell connection, but it could be used for describing details about a wifi connection.' examples: '2G' - id: host.carrier.name diff --git a/semantic-conventions/src/tests/data/markdown/parameter_empty/faas.yaml b/semantic-conventions/src/tests/data/markdown/parameter_empty/faas.yaml index 648eb26e..6e3ad387 100644 --- a/semantic-conventions/src/tests/data/markdown/parameter_empty/faas.yaml +++ b/semantic-conventions/src/tests/data/markdown/parameter_empty/faas.yaml @@ -17,17 +17,22 @@ groups: - id: datasource value: 'datasource' brief: 'A response to some data source operation such as a database or filesystem read/write.' + stability: experimental - id: http value: 'http' brief: 'To provide an answer to an inbound HTTP request' + stability: experimental - id: pubsub value: 'pubsub' brief: 'A function is set to be executed when messages are sent to a messaging system.' + stability: experimental - id: timer value: 'timer' brief: 'A function is scheduled to be executed regularly.' + stability: experimental - id: other value: 'other' + stability: experimental - id: execution stability: experimental type: string diff --git a/semantic-conventions/src/tests/data/markdown/parameter_full/faas.yaml b/semantic-conventions/src/tests/data/markdown/parameter_full/faas.yaml index 0fb1cad4..4064b531 100644 --- a/semantic-conventions/src/tests/data/markdown/parameter_full/faas.yaml +++ b/semantic-conventions/src/tests/data/markdown/parameter_full/faas.yaml @@ -17,17 +17,22 @@ groups: - id: datasource value: 'datasource' brief: 'A response to some data source operation such as a database or filesystem read/write.' + stability: experimental - id: http value: 'http' brief: 'To provide an answer to an inbound HTTP request' + stability: experimental - id: pubsub value: 'pubsub' brief: 'A function is set to be executed when messages are sent to a messaging system.' + stability: experimental - id: timer value: 'timer' brief: 'A function is scheduled to be executed regularly.' + stability: experimental - id: other value: 'other' + stability: experimental - id: execution stability: experimental type: string diff --git a/semantic-conventions/src/tests/data/markdown/parameter_remove_constraint/database.yaml b/semantic-conventions/src/tests/data/markdown/parameter_remove_constraint/database.yaml index ebad25df..8972e112 100644 --- a/semantic-conventions/src/tests/data/markdown/parameter_remove_constraint/database.yaml +++ b/semantic-conventions/src/tests/data/markdown/parameter_remove_constraint/database.yaml @@ -17,24 +17,31 @@ groups: - id: sql value: 'sql' brief: 'A SQL database' + stability: experimental - id: cassandra value: 'cassandra' brief: 'Apache Cassandra' + stability: experimental - id: hbase value: 'hbase' brief: 'Apache HBase' + stability: experimental - id: mongodb value: 'mongodb' brief: 'MongoDB' + stability: experimental - id: redis value: 'redis' brief: 'Redis' + stability: experimental - id: couchbase value: 'couchbase' brief: 'Couchbase' + stability: experimental - id: couchdb value: 'couchdb' brief: 'CouchDB' + stability: experimental requirement_level: required brief: > Database type. For any SQL database, "sql". @@ -47,102 +54,135 @@ groups: - id: mssql value: 'mssql' brief: 'Microsoft SQL Server' + stability: experimental - id: mysql value: 'mysql' brief: 'MySQL' + stability: experimental - id: oracle value: 'oracle' brief: 'Oracle' + stability: experimental - id: db2 value: 'db2' brief: 'IBM Db2' + stability: experimental - id: postgresql value: 'postgresql' brief: 'PostgreSQL' + stability: experimental - id: redshift value: 'redshift' brief: 'Amazon Redshift' + stability: experimental - id: hive value: 'hive' brief: 'Apache Hive' + stability: experimental - id: cloudscape value: 'cloudscape' brief: 'Cloudscape' + stability: experimental - id: hsqlsb value: 'hsqlsb' brief: 'HyperSQL DataBase' + stability: experimental - id: progress value: 'progress' brief: 'Progress Database' + stability: experimental - id: maxdb value: 'maxdb' brief: 'SAP MaxDB' + stability: experimental - id: hanadb value: 'hanadb' brief: 'SAP HANA' + stability: experimental - id: ingres value: 'ingres' brief: 'Ingres' + stability: experimental - id: firstsql value: 'firstsql' brief: 'FirstSQL' + stability: experimental - id: edb value: 'edb' brief: 'EnterpriseDB' + stability: experimental - id: cache value: 'cache' brief: 'InterSystems Caché' + stability: experimental - id: adabas value: 'adabas' brief: 'Adabas (Adaptable Database System)' + stability: experimental - id: firebird value: 'firebird' brief: 'Firebird' + stability: experimental - id: derby value: 'derby' brief: 'Apache Derby' + stability: experimental - id: filemaker value: 'filemaker' brief: 'FileMaker' + stability: experimental - id: informix value: 'informix' brief: 'Informix' + stability: experimental - id: instantdb value: 'instantdb' brief: 'InstantDB' + stability: experimental - id: interbase value: 'interbase' brief: 'InterBase' + stability: experimental - id: mariadb value: 'mariadb' brief: 'MariaDB' + stability: experimental - id: netezza value: 'netezza' brief: 'Netezza' + stability: experimental - id: pervasive value: 'pervasive' brief: 'Pervasive PSQL' + stability: experimental - id: pointbase value: 'pointbase' brief: 'PointBase' + stability: experimental - id: sqlite value: 'sqlite' brief: 'SQLite' + stability: experimental - id: sybase value: 'sybase' brief: 'Sybase' + stability: experimental - id: teradata value: 'teradata' brief: 'Teradata' + stability: experimental - id: vertica value: 'vertica' brief: 'Vertica' + stability: experimental - id: h2 value: 'h2' brief: 'H2' + stability: experimental - id: coldfusion value: 'coldfusion' brief: 'ColdFusion IMQ' + stability: experimental requirement_level: conditionally_required: for `db.type="sql"` brief: > diff --git a/semantic-conventions/src/tests/data/markdown/parameter_tag/database.yaml b/semantic-conventions/src/tests/data/markdown/parameter_tag/database.yaml index 36240552..2ff73e47 100644 --- a/semantic-conventions/src/tests/data/markdown/parameter_tag/database.yaml +++ b/semantic-conventions/src/tests/data/markdown/parameter_tag/database.yaml @@ -17,24 +17,31 @@ groups: - id: sql value: 'sql' brief: 'A SQL database' + stability: experimental - id: cassandra value: 'cassandra' brief: 'Apache Cassandra' + stability: experimental - id: hbase value: 'hbase' brief: 'Apache HBase' + stability: experimental - id: mongodb value: 'mongodb' brief: 'MongoDB' + stability: experimental - id: redis value: 'redis' brief: 'Redis' + stability: experimental - id: couchbase value: 'couchbase' brief: 'Couchbase' + stability: experimental - id: couchdb value: 'couchdb' brief: 'CouchDB' + stability: experimental requirement_level: required brief: > Database type. For any SQL database, "sql". @@ -47,102 +54,135 @@ groups: - id: mssql value: 'mssql' brief: 'Microsoft SQL Server' + stability: experimental - id: mysql value: 'mysql' brief: 'MySQL' + stability: experimental - id: oracle value: 'oracle' brief: 'Oracle' + stability: experimental - id: db2 value: 'db2' brief: 'IBM Db2' + stability: experimental - id: postgresql value: 'postgresql' brief: 'PostgreSQL' + stability: experimental - id: redshift value: 'redshift' brief: 'Amazon Redshift' + stability: experimental - id: hive value: 'hive' brief: 'Apache Hive' + stability: experimental - id: cloudscape value: 'cloudscape' brief: 'Cloudscape' + stability: experimental - id: hsqlsb value: 'hsqlsb' brief: 'HyperSQL DataBase' + stability: experimental - id: progress value: 'progress' brief: 'Progress Database' + stability: experimental - id: maxdb value: 'maxdb' brief: 'SAP MaxDB' + stability: experimental - id: hanadb value: 'hanadb' brief: 'SAP HANA' + stability: experimental - id: ingres value: 'ingres' brief: 'Ingres' + stability: experimental - id: firstsql value: 'firstsql' brief: 'FirstSQL' + stability: experimental - id: edb value: 'edb' brief: 'EnterpriseDB' + stability: experimental - id: cache value: 'cache' brief: 'InterSystems Caché' + stability: experimental - id: adabas value: 'adabas' brief: 'Adabas (Adaptable Database System)' + stability: experimental - id: firebird value: 'firebird' brief: 'Firebird' + stability: experimental - id: derby value: 'derby' brief: 'Apache Derby' + stability: experimental - id: filemaker value: 'filemaker' brief: 'FileMaker' + stability: experimental - id: informix value: 'informix' brief: 'Informix' + stability: experimental - id: instantdb value: 'instantdb' brief: 'InstantDB' + stability: experimental - id: interbase value: 'interbase' brief: 'InterBase' + stability: experimental - id: mariadb value: 'mariadb' brief: 'MariaDB' + stability: experimental - id: netezza value: 'netezza' brief: 'Netezza' + stability: experimental - id: pervasive value: 'pervasive' brief: 'Pervasive PSQL' + stability: experimental - id: pointbase value: 'pointbase' brief: 'PointBase' + stability: experimental - id: sqlite value: 'sqlite' brief: 'SQLite' + stability: experimental - id: sybase value: 'sybase' brief: 'Sybase' + stability: experimental - id: teradata value: 'teradata' brief: 'Teradata' + stability: experimental - id: vertica value: 'vertica' brief: 'Vertica' + stability: experimental - id: h2 value: 'h2' brief: 'H2' + stability: experimental - id: coldfusion value: 'coldfusion' brief: 'ColdFusion IMQ' + stability: experimental requirement_level: recommended: for `db.type="sql"` brief: > diff --git a/semantic-conventions/src/tests/data/markdown/parameter_tag_empty/database.yaml b/semantic-conventions/src/tests/data/markdown/parameter_tag_empty/database.yaml index 7bb4e580..356b7a74 100644 --- a/semantic-conventions/src/tests/data/markdown/parameter_tag_empty/database.yaml +++ b/semantic-conventions/src/tests/data/markdown/parameter_tag_empty/database.yaml @@ -17,24 +17,31 @@ groups: - id: sql value: 'sql' brief: 'A SQL database' + stability: experimental - id: cassandra value: 'cassandra' brief: 'Apache Cassandra' + stability: experimental - id: hbase value: 'hbase' brief: 'Apache HBase' + stability: experimental - id: mongodb value: 'mongodb' brief: 'MongoDB' + stability: experimental - id: redis value: 'redis' brief: 'Redis' + stability: experimental - id: couchbase value: 'couchbase' brief: 'Couchbase' + stability: experimental - id: couchdb value: 'couchdb' brief: 'CouchDB' + stability: experimental requirement_level: required brief: > Database type. For any SQL database, "sql". @@ -47,102 +54,135 @@ groups: - id: mssql value: 'mssql' brief: 'Microsoft SQL Server' + stability: experimental - id: mysql value: 'mysql' brief: 'MySQL' + stability: experimental - id: oracle value: 'oracle' brief: 'Oracle' + stability: experimental - id: db2 value: 'db2' brief: 'IBM Db2' + stability: experimental - id: postgresql value: 'postgresql' brief: 'PostgreSQL' + stability: experimental - id: redshift value: 'redshift' brief: 'Amazon Redshift' + stability: experimental - id: hive value: 'hive' brief: 'Apache Hive' + stability: experimental - id: cloudscape value: 'cloudscape' brief: 'Cloudscape' + stability: experimental - id: hsqlsb value: 'hsqlsb' brief: 'HyperSQL DataBase' + stability: experimental - id: progress value: 'progress' brief: 'Progress Database' + stability: experimental - id: maxdb value: 'maxdb' brief: 'SAP MaxDB' + stability: experimental - id: hanadb value: 'hanadb' brief: 'SAP HANA' + stability: experimental - id: ingres value: 'ingres' brief: 'Ingres' + stability: experimental - id: firstsql value: 'firstsql' brief: 'FirstSQL' + stability: experimental - id: edb value: 'edb' brief: 'EnterpriseDB' + stability: experimental - id: cache value: 'cache' brief: 'InterSystems Caché' + stability: experimental - id: adabas value: 'adabas' brief: 'Adabas (Adaptable Database System)' + stability: experimental - id: firebird value: 'firebird' brief: 'Firebird' + stability: experimental - id: derby value: 'derby' brief: 'Apache Derby' + stability: experimental - id: filemaker value: 'filemaker' brief: 'FileMaker' + stability: experimental - id: informix value: 'informix' brief: 'Informix' + stability: experimental - id: instantdb value: 'instantdb' brief: 'InstantDB' + stability: experimental - id: interbase value: 'interbase' brief: 'InterBase' + stability: experimental - id: mariadb value: 'mariadb' brief: 'MariaDB' + stability: experimental - id: netezza value: 'netezza' brief: 'Netezza' + stability: experimental - id: pervasive value: 'pervasive' brief: 'Pervasive PSQL' + stability: experimental - id: pointbase value: 'pointbase' brief: 'PointBase' + stability: experimental - id: sqlite value: 'sqlite' brief: 'SQLite' + stability: experimental - id: sybase value: 'sybase' brief: 'Sybase' + stability: experimental - id: teradata value: 'teradata' brief: 'Teradata' + stability: experimental - id: vertica value: 'vertica' brief: 'Vertica' + stability: experimental - id: h2 value: 'h2' brief: 'H2' + stability: experimental - id: coldfusion value: 'coldfusion' brief: 'ColdFusion IMQ' + stability: experimental requirement_level: conditionally_required: for `db.type="sql"` brief: > diff --git a/semantic-conventions/src/tests/data/markdown/stability/all_badges_expected.md b/semantic-conventions/src/tests/data/markdown/stability/all_badges_expected.md index 856f8a0c..21578858 100644 --- a/semantic-conventions/src/tests/data/markdown/stability/all_badges_expected.md +++ b/semantic-conventions/src/tests/data/markdown/stability/all_badges_expected.md @@ -5,6 +5,16 @@ | [`test.deprecated_stable_attr`](stable_badges_expected.md) | boolean | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
| | `Required` | | [`test.exp_attr`](stable_badges_expected.md) | boolean | ![Experimental](https://img.shields.io/badge/-experimental-blue)
| | `Required` | | [`test.stable_attr`](stable_badges_expected.md) | boolean | ![Stable](https://img.shields.io/badge/-stable-lightgreen)
| | `Required` | +| [`test.stable_enum_attr`](stable_badges_expected.md) | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)
| `one` | `Recommended` | + +`test.stable_enum_attr` MUST be one of the following: + +| Value | Description | +|---|---| +| `one` | ![Stable](https://img.shields.io/badge/-stable-lightgreen)
member one | +| `two` | ![Experimental](https://img.shields.io/badge/-experimental-blue)
member two | +| `three` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
member three | +| `four` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
member four | @@ -14,6 +24,7 @@ | [`test.deprecated_stable_attr`](stable_badges_expected.md) | boolean | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
| | `Required` | | [`test.exp_attr`](stable_badges_expected.md) | boolean | ![Experimental](https://img.shields.io/badge/-experimental-blue)
| | `Required` | | [`test.stable_attr`](stable_badges_expected.md) | boolean | ![Stable](https://img.shields.io/badge/-stable-lightgreen)
| | `Required` | +| [`test.stable_enum_attr`](stable_badges_expected.md) | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)
| `one` | `Recommended` | @@ -23,6 +34,16 @@ | [`test.deprecated_stable_attr`](stable_badges_expected.md) | boolean | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
| | `Required` | | [`test.exp_attr`](stable_badges_expected.md) | boolean | ![Experimental](https://img.shields.io/badge/-experimental-blue)
| | `Required` | | [`test.stable_attr`](stable_badges_expected.md) | boolean | ![Stable](https://img.shields.io/badge/-stable-lightgreen)
| | `Required` | +| [`test.stable_enum_attr`](stable_badges_expected.md) | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)
| `one` | `Recommended` | + +`test.stable_enum_attr` MUST be one of the following: + +| Value | Description | +|---|---| +| `one` | ![Stable](https://img.shields.io/badge/-stable-lightgreen)
member one | +| `two` | ![Experimental](https://img.shields.io/badge/-experimental-blue)
member two | +| `three` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
member three | +| `four` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
member four | diff --git a/semantic-conventions/src/tests/data/markdown/stability/stability.yaml b/semantic-conventions/src/tests/data/markdown/stability/stability.yaml index 6ad528db..357f09f2 100644 --- a/semantic-conventions/src/tests/data/markdown/stability/stability.yaml +++ b/semantic-conventions/src/tests/data/markdown/stability/stability.yaml @@ -26,6 +26,29 @@ groups: stability: experimental deprecated: "Removed." brief: "" + - id: stable_enum_attr + brief: "" + stability: stable + type: + members: + - id: one + value: "one" + brief: 'member one' + stability: stable + - id: two + value: "two" + stability: experimental + brief: 'member two' + - id: three + value: "three" + stability: experimental + deprecated: "Removed." + brief: 'member three' + - id: four + value: "four" + stability: stable + deprecated: "Removed." + brief: 'member four' - id: ref_test brief: 'ref_test' attributes: @@ -33,6 +56,7 @@ groups: - ref: test.stable_attr - ref: test.deprecated_stable_attr - ref: test.deprecated_experimental_attr + - ref: test.stable_enum_attr - id: extends_test brief: 'extends_test' extends: test @@ -63,4 +87,4 @@ groups: instrument: updowncounter unit: "{d}" attributes: - - ref: test.deprecated_experimental_attr \ No newline at end of file + - ref: test.deprecated_experimental_attr diff --git a/semantic-conventions/src/tests/data/markdown/stability/stable_badges_expected.md b/semantic-conventions/src/tests/data/markdown/stability/stable_badges_expected.md index b1e779ad..42717ce6 100644 --- a/semantic-conventions/src/tests/data/markdown/stability/stable_badges_expected.md +++ b/semantic-conventions/src/tests/data/markdown/stability/stable_badges_expected.md @@ -5,6 +5,16 @@ | [`test.deprecated_stable_attr`](stable_badges_expected.md) | boolean | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
| | `Required` | | [`test.exp_attr`](stable_badges_expected.md) | boolean | | | `Required` | | [`test.stable_attr`](stable_badges_expected.md) | boolean | ![Stable](https://img.shields.io/badge/-stable-lightgreen)
| | `Required` | +| [`test.stable_enum_attr`](stable_badges_expected.md) | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)
| `one` | `Recommended` | + +`test.stable_enum_attr` MUST be one of the following: + +| Value | Description | +|---|---| +| `one` | ![Stable](https://img.shields.io/badge/-stable-lightgreen)
member one | +| `two` | member two | +| `three` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
member three | +| `four` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
member four | @@ -14,6 +24,7 @@ | [`test.deprecated_stable_attr`](stable_badges_expected.md) | boolean | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
| | `Required` | | [`test.exp_attr`](stable_badges_expected.md) | boolean | | | `Required` | | [`test.stable_attr`](stable_badges_expected.md) | boolean | ![Stable](https://img.shields.io/badge/-stable-lightgreen)
| | `Required` | +| [`test.stable_enum_attr`](stable_badges_expected.md) | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)
| `one` | `Recommended` | @@ -23,6 +34,16 @@ | [`test.deprecated_stable_attr`](stable_badges_expected.md) | boolean | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
| | `Required` | | [`test.exp_attr`](stable_badges_expected.md) | boolean | | | `Required` | | [`test.stable_attr`](stable_badges_expected.md) | boolean | ![Stable](https://img.shields.io/badge/-stable-lightgreen)
| | `Required` | +| [`test.stable_enum_attr`](stable_badges_expected.md) | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)
| `one` | `Recommended` | + +`test.stable_enum_attr` MUST be one of the following: + +| Value | Description | +|---|---| +| `one` | ![Stable](https://img.shields.io/badge/-stable-lightgreen)
member one | +| `two` | member two | +| `three` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
member three | +| `four` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)
member four | diff --git a/semantic-conventions/src/tests/data/yaml/cloud.yaml b/semantic-conventions/src/tests/data/yaml/cloud.yaml index a376ff21..8ea59ac8 100644 --- a/semantic-conventions/src/tests/data/yaml/cloud.yaml +++ b/semantic-conventions/src/tests/data/yaml/cloud.yaml @@ -12,10 +12,13 @@ groups: members: - id: aws value: 'aws' + stability: experimental - id: gcp value: 'gcp' + stability: experimental - id: azure value: 'azure' + stability: experimental brief: > Name of the cloud provider. - id: account.id diff --git a/semantic-conventions/src/tests/data/yaml/errors/empty/empty_example_enum.yaml b/semantic-conventions/src/tests/data/yaml/errors/empty/empty_example_enum.yaml index 98743a36..8863addf 100644 --- a/semantic-conventions/src/tests/data/yaml/errors/empty/empty_example_enum.yaml +++ b/semantic-conventions/src/tests/data/yaml/errors/empty/empty_example_enum.yaml @@ -13,5 +13,6 @@ groups: - id: first value: 'first' note: 'first' + stability: experimental requirement_level: required brief: 'test' \ No newline at end of file diff --git a/semantic-conventions/src/tests/data/yaml/errors/stability/experimental_attr_stable_member.yaml b/semantic-conventions/src/tests/data/yaml/errors/stability/experimental_attr_stable_member.yaml new file mode 100644 index 00000000..db06724c --- /dev/null +++ b/semantic-conventions/src/tests/data/yaml/errors/stability/experimental_attr_stable_member.yaml @@ -0,0 +1,14 @@ +groups: + - id: test + type: attribute_group + brief: 'test' + attributes: + - id: enum_attr + brief: "" + stability: experimental + type: + members: + - id: one + value: "one" + brief: 'member one' + stability: stable diff --git a/semantic-conventions/src/tests/data/yaml/errors/stability/missing_stability_on_enum_member.yaml b/semantic-conventions/src/tests/data/yaml/errors/stability/missing_stability_on_enum_member.yaml new file mode 100644 index 00000000..79801692 --- /dev/null +++ b/semantic-conventions/src/tests/data/yaml/errors/stability/missing_stability_on_enum_member.yaml @@ -0,0 +1,13 @@ +groups: + - id: test + type: attribute_group + brief: 'test' + attributes: + - id: enum_attr + brief: "" + type: + members: + - id: one + value: "one" + brief: 'member one' + stability: experimental \ No newline at end of file diff --git a/semantic-conventions/src/tests/data/yaml/errors/stability/multiple_stability_values_on_enum_member.yaml b/semantic-conventions/src/tests/data/yaml/errors/stability/multiple_stability_values_on_enum_member.yaml new file mode 100644 index 00000000..c4659d30 --- /dev/null +++ b/semantic-conventions/src/tests/data/yaml/errors/stability/multiple_stability_values_on_enum_member.yaml @@ -0,0 +1,14 @@ +groups: + - id: test + type: attribute_group + brief: 'test' + attributes: + - id: enum_attr + brief: "" + type: + members: + - id: one + value: "one" + brief: 'member one' + stability: experimental + stability: stable diff --git a/semantic-conventions/src/tests/data/yaml/errors/stability/wrong_value.yaml b/semantic-conventions/src/tests/data/yaml/errors/stability/wrong_stability_value.yaml similarity index 100% rename from semantic-conventions/src/tests/data/yaml/errors/stability/wrong_value.yaml rename to semantic-conventions/src/tests/data/yaml/errors/stability/wrong_stability_value.yaml diff --git a/semantic-conventions/src/tests/data/yaml/errors/stability/wrong_stability_value_on_enum_member.yaml b/semantic-conventions/src/tests/data/yaml/errors/stability/wrong_stability_value_on_enum_member.yaml new file mode 100644 index 00000000..acf36479 --- /dev/null +++ b/semantic-conventions/src/tests/data/yaml/errors/stability/wrong_stability_value_on_enum_member.yaml @@ -0,0 +1,14 @@ +groups: + - id: test + type: attribute_group + brief: 'test' + attributes: + - id: enum_attr + brief: "" + type: + members: + - id: one + value: "one" + brief: 'member one' + stability: will_fail + stability: experimental \ No newline at end of file diff --git a/semantic-conventions/src/tests/data/yaml/faas.yaml b/semantic-conventions/src/tests/data/yaml/faas.yaml index 2376f728..9dbe4721 100644 --- a/semantic-conventions/src/tests/data/yaml/faas.yaml +++ b/semantic-conventions/src/tests/data/yaml/faas.yaml @@ -15,18 +15,23 @@ groups: allow_custom_values: false members: - id: datasource + stability: experimental value: 'datasource' brief: 'A response to some data source operation such as a database or filesystem read/write.' - id: http + stability: experimental value: 'http' brief: 'To provide an answer to an inbound HTTP request' - id: pubsub + stability: experimental value: 'pubsub' brief: 'A function is set to be executed when messages are sent to a messaging system.' - id: timer + stability: experimental value: 'timer' brief: 'A function is scheduled to be executed regularly.' - id: other + stability: experimental value: 'other' - id: execution stability: experimental @@ -58,10 +63,13 @@ groups: members: - id: insert value: 'insert' + stability: experimental - id: edit value: 'edit' + stability: experimental - id: delete value: 'delete' + stability: experimental brief: 'Describes the type of the operation that was performed on the data.' - id: time stability: experimental diff --git a/semantic-conventions/src/tests/data/yaml/general.yaml b/semantic-conventions/src/tests/data/yaml/general.yaml index 75526142..9a707e13 100644 --- a/semantic-conventions/src/tests/data/yaml/general.yaml +++ b/semantic-conventions/src/tests/data/yaml/general.yaml @@ -12,20 +12,26 @@ groups: members: - id: ip.tcp value: "IP.TCP" + stability: experimental - id: ip.udp value: "IP.UDP" + stability: experimental - id: ip value: "IP" brief: 'Another IP-based protocol' + stability: experimental - id: unix value: "Unix" brief: 'Unix Domain socket. See below.' + stability: experimental - id: pipe value: "pipe" brief: 'Named or anonymous pipe. See note below.' + stability: experimental - id: inproc value: "inproc" brief: 'In-process communication.' + stability: experimental note: > Signals that there is only in-process communication not using a "real" network protocol in cases where network attributes would normally be expected. Usually all other network @@ -33,6 +39,7 @@ groups: - id: other value: "other" brief: 'Something else (non IP-based).' + stability: experimental brief: > Transport protocol used. See note below. examples: 'ip.tcp' diff --git a/semantic-conventions/src/tests/data/yaml/http.yaml b/semantic-conventions/src/tests/data/yaml/http.yaml index 7b9c5746..b1c9703f 100644 --- a/semantic-conventions/src/tests/data/yaml/http.yaml +++ b/semantic-conventions/src/tests/data/yaml/http.yaml @@ -58,18 +58,23 @@ groups: allow_custom_values: true members: - id: http_1_0 + stability: experimental value: '1.0' brief: 'HTTP 1.0' - id: http_1_1 + stability: experimental value: '1.1' brief: 'HTTP 1.1' - id: http_2_0 + stability: experimental value: '2.0' brief: 'HTTP 2' - id: spdy + stability: experimental value: 'SPDY' brief: 'SPDY protocol.' - id: quic + stability: experimental value: 'QUIC' brief: 'QUIC protocol.' brief: 'Kind of HTTP protocol used' diff --git a/semantic-conventions/src/tests/semconv/model/test_error_detection.py b/semantic-conventions/src/tests/semconv/model/test_error_detection.py index a37881e2..62dfe360 100644 --- a/semantic-conventions/src/tests/semconv/model/test_error_detection.py +++ b/semantic-conventions/src/tests/semconv/model/test_error_detection.py @@ -134,7 +134,7 @@ def test_invalid_key_in_constraint(self): def test_invalid_stability(self): with self.assertRaises(ValidationError) as ex: - self.open_yaml("yaml/errors/stability/wrong_value.yaml") + self.open_yaml("yaml/errors/stability/wrong_stability_value.yaml") self.fail() e = ex.exception msg = e.message.lower() @@ -172,6 +172,46 @@ def test_invalid_semconv_stability_with_deprecated(self): self.assertIn("value 'deprecated' is not allowed as a stability marker", msg) self.assertEqual(e.line, 6) + def test_wrong_stability_value_on_enum_member(self): + with self.assertRaises(ValidationError) as ex: + self.open_yaml( + "yaml/errors/stability/wrong_stability_value_on_enum_member.yaml" + ) + self.fail() + e = ex.exception + msg = e.message.lower() + self.assertIn("value 'will_fail' is not allowed as a stability marker", msg) + self.assertEqual(e.line, 13) + + def test_missing_stability_value_on_enum_member(self): + with self.assertRaises(ValidationError) as ex: + self.open_yaml( + "yaml/errors/stability/missing_stability_on_enum_member.yaml" + ) + self.fail() + e = ex.exception + msg = e.message.lower() + self.assertIn("enumeration member 'one' must have a stability level", msg) + self.assertEqual(e.line, 10) + + def test_multiple_stability_values_on_enum_member(self): + with self.assertRaises(DuplicateKeyError): + self.open_yaml( + "yaml/errors/stability/multiple_stability_values_on_enum_member.yaml" + ) + + def test_experimental_attr_stable_member(self): + with self.assertRaises(ValidationError) as ex: + self.open_yaml("yaml/errors/stability/experimental_attr_stable_member.yaml") + self.fail() + e = ex.exception + msg = e.message.lower() + self.assertIn( + "member 'one' is marked as stable but it is not allowed on experimental attribute!", + msg, + ) + self.assertEqual(e.line, 9) + def test_invalid_deprecated_empty_string(self): with self.assertRaises(ValidationError) as ex: self.open_yaml("yaml/errors/deprecated/deprecation_empty_string.yaml") diff --git a/semantic-conventions/src/tests/semconv/templating/test_compatibility.py b/semantic-conventions/src/tests/semconv/templating/test_compatibility.py index 2497fdd5..70db2e3e 100644 --- a/semantic-conventions/src/tests/semconv/templating/test_compatibility.py +++ b/semantic-conventions/src/tests/semconv/templating/test_compatibility.py @@ -146,6 +146,11 @@ def testEnumTypeChanged(self): "first.third_attr.enum_one", "value changed from 'one' to '1'", ), + Problem( + "attribute", + "first.forth_attr", + "enum type changed from 'string' to 'int'", + ), ] self.assert_errors(expected_errors, problems) diff --git a/semantic-conventions/syntax.md b/semantic-conventions/syntax.md index 3b1ba202..84a7544a 100644 --- a/semantic-conventions/syntax.md +++ b/semantic-conventions/syntax.md @@ -93,7 +93,7 @@ allow_custom_values := boolean members ::= member {member} -member ::= id value [brief] [note] +member ::= id value [brief] [note] [stability] [deprecated] requirement_level ::= "required" | "conditionally_required" @@ -376,6 +376,8 @@ An enum entry has the following fields: - `value`, string, int, or boolean; value of the enum entry. - `brief`, optional string, brief description of the enum entry value. It defaults to the value of `id`. - `note`, optional string, longer description. It defaults to an empty string. +- `stability`, required stability level. Attributes marked as experimental cannot have stable members. +- `deprecated`, optional string, similarly to semantic convention and attribute deprecation, marks specific member as deprecated. ### Constraints