From b332b3571b70054cd9e17c83cae5ec5c87a7d5af Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 2 Nov 2023 05:47:58 -0700 Subject: [PATCH 1/4] Update tools to fix CI (#231) --- semantic-conventions/dev-requirements.txt | 4 ++-- .../src/opentelemetry/semconv/model/semantic_convention.py | 3 ++- .../src/opentelemetry/semconv/model/utils.py | 2 +- .../opentelemetry/semconv/templating/markdown/__init__.py | 5 ++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/semantic-conventions/dev-requirements.txt b/semantic-conventions/dev-requirements.txt index 823404f7..31bd92f2 100644 --- a/semantic-conventions/dev-requirements.txt +++ b/semantic-conventions/dev-requirements.txt @@ -1,6 +1,6 @@ black==22.3.0 mypy==0.910 pytest==6.2.5 -flake8==3.9.2 -pylint==2.15.5 +flake8==6.1.0 +pylint==3.0.2 isort==5.12.0 diff --git a/semantic-conventions/src/opentelemetry/semconv/model/semantic_convention.py b/semantic-conventions/src/opentelemetry/semconv/model/semantic_convention.py index 15ec3b61..13ade651 100644 --- a/semantic-conventions/src/opentelemetry/semconv/model/semantic_convention.py +++ b/semantic-conventions/src/opentelemetry/semconv/model/semantic_convention.py @@ -327,7 +327,8 @@ def check_unique_fqns(self): group_by_fqn[attr.fqn] = model.semconv_id def finish(self): - """Resolves values referenced from other models using `ref` and `extends` attributes AFTER all models were parsed. + """Resolves values referenced from other models using `ref` and `extends` attributes + AFTER all models were parsed. Here, sanity checks for `ref/extends` attributes are performed. """ # Before resolving attributes, we verify that no duplicate exists. diff --git a/semantic-conventions/src/opentelemetry/semconv/model/utils.py b/semantic-conventions/src/opentelemetry/semconv/model/utils.py index 8f114c3c..291d28f5 100644 --- a/semantic-conventions/src/opentelemetry/semconv/model/utils.py +++ b/semantic-conventions/src/opentelemetry/semconv/model/utils.py @@ -13,7 +13,7 @@ # limitations under the License. import re -from typing import Tuple +from typing import Tuple # noqa: F401 from opentelemetry.semconv.model.exceptions import ValidationError diff --git a/semantic-conventions/src/opentelemetry/semconv/templating/markdown/__init__.py b/semantic-conventions/src/opentelemetry/semconv/templating/markdown/__init__.py index 9871662e..50bd1d22 100644 --- a/semantic-conventions/src/opentelemetry/semconv/templating/markdown/__init__.py +++ b/semantic-conventions/src/opentelemetry/semconv/templating/markdown/__init__.py @@ -176,7 +176,7 @@ def derive_requirement_level(self, attribute: SemanticAttribute): else: # We put the condition in the notes after the table self.render_ctx.add_note(attribute.requirement_level_msg) - required = f"Conditionally Required: [{ len(self.render_ctx.notes)}]" + required = f"Conditionally Required: [{len(self.render_ctx.notes)}]" elif attribute.requirement_level == RequirementLevel.OPT_IN: required = "Opt-In" else: # attribute.requirement_level == Required.RECOMMENDED or None @@ -391,7 +391,7 @@ def to_markdown_constraint( if isinstance(obj, AnyOf): self.to_markdown_anyof(obj, output) elif not isinstance(obj, Include): - raise Exception(f"Trying to generate Markdown for a wrong type {type(obj)}") + raise TypeError(f"Trying to generate Markdown for a wrong type {type(obj)}") def render_md(self): for md_filename in self.file_names: @@ -429,7 +429,6 @@ def _create_attribute_location_dict(self): raise ValueError( f"Semantic Convention ID {semconv_id} not found" ) - a: SemanticAttribute valid_attr = ( a for a in semconv.attributes_and_templates From 193954a41b297bd2b2eff605438a3c07553854ac Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Thu, 2 Nov 2023 07:59:05 -0700 Subject: [PATCH 2/4] Update sampling-relevant MUST -> SHOULD (#230) Co-authored-by: Armin Ruech <7052238+arminru@users.noreply.github.com> --- semantic-conventions/CHANGELOG.md | 3 +++ .../src/opentelemetry/semconv/templating/markdown/__init__.py | 4 ++-- .../src/tests/data/markdown/ref_extends/expected.md | 2 +- .../src/tests/data/markdown/sampling_relevant/expected.md | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/semantic-conventions/CHANGELOG.md b/semantic-conventions/CHANGELOG.md index be9ba3f3..6a80ccbf 100644 --- a/semantic-conventions/CHANGELOG.md +++ b/semantic-conventions/CHANGELOG.md @@ -4,6 +4,9 @@ Please update the changelog as part of any significant pull request. ## Unreleased +- Rephrase and relax sampling-relevant description + ([#230](https://github.com/open-telemetry/build-tools/pull/230)) + ## v0.22.0 - When an attribute is referenced using `ref:` from a group that already inherits the attribute with `extends:`, resolve the reference to the closest inherited attribute instead of the primary definition. This makes a difference in case the inherited reference overwrites any properties. diff --git a/semantic-conventions/src/opentelemetry/semconv/templating/markdown/__init__.py b/semantic-conventions/src/opentelemetry/semconv/templating/markdown/__init__.py index 50bd1d22..64c8b744 100644 --- a/semantic-conventions/src/opentelemetry/semconv/templating/markdown/__init__.py +++ b/semantic-conventions/src/opentelemetry/semconv/templating/markdown/__init__.py @@ -293,8 +293,8 @@ def to_creation_time_attributes( """ if sampling_relevant_attrs: output.write( - "\nFollowing attributes MUST be provided **at span creation time** (when provided at all), " - + "so they can be considered for sampling decisions:\n\n" + "\nThe following attributes can be important for making sampling decisions " + + "and SHOULD be provided **at span creation time** (if provided at all):\n\n" ) for attr in sampling_relevant_attrs: diff --git a/semantic-conventions/src/tests/data/markdown/ref_extends/expected.md b/semantic-conventions/src/tests/data/markdown/ref_extends/expected.md index ebb17dd4..82b59bbc 100644 --- a/semantic-conventions/src/tests/data/markdown/ref_extends/expected.md +++ b/semantic-conventions/src/tests/data/markdown/ref_extends/expected.md @@ -7,7 +7,7 @@ **[1]:** Note on the overridden attribute definition. -Following attributes MUST be provided **at span creation time** (when provided at all), so they can be considered for sampling decisions: +The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): * [`server.address`](input_server.md) diff --git a/semantic-conventions/src/tests/data/markdown/sampling_relevant/expected.md b/semantic-conventions/src/tests/data/markdown/sampling_relevant/expected.md index e3cb8b73..e00b6a84 100644 --- a/semantic-conventions/src/tests/data/markdown/sampling_relevant/expected.md +++ b/semantic-conventions/src/tests/data/markdown/sampling_relevant/expected.md @@ -16,7 +16,7 @@ **[1]:** `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`. -Following attributes MUST be provided **at span creation time** (when provided at all), so they can be considered for sampling decisions: +The following attributes can be important for making sampling decisions and SHOULD be provided **at span creation time** (if provided at all): * `http.host` * `http.method` From 653b4e73997332d72df1f583f9ae425c20c67f29 Mon Sep 17 00:00:00 2001 From: Armin Ruech <7052238+arminru@users.noreply.github.com> Date: Thu, 2 Nov 2023 16:09:26 +0100 Subject: [PATCH 3/4] Prepare v0.23.0 release (#235) --- semantic-conventions/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/semantic-conventions/CHANGELOG.md b/semantic-conventions/CHANGELOG.md index 6a80ccbf..153d7587 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 +## v0.23.0 + - Rephrase and relax sampling-relevant description ([#230](https://github.com/open-telemetry/build-tools/pull/230)) From 259a02fb341d9fae89f8fdaf9c55fdb8e92c4428 Mon Sep 17 00:00:00 2001 From: Armin Ruech <7052238+arminru@users.noreply.github.com> Date: Fri, 17 Nov 2023 15:03:14 +0100 Subject: [PATCH 4/4] Add list of maintainers to README.md (#237) --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 73826806..814b7b5f 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,24 @@ * [Protobuf](./protobuf/README.md) * [Semantic Convention Generator](./semantic-conventions/README.md) + +## Contributing + +See [CONTRIBUTING.md](CONTRIBUTING.md) + +### Approvers + +- OpenTelemetry Specification Approvers ([@open-telemetry/specs-approvers](https://github.com/orgs/open-telemetry/teams/specs-approvers)) + - See [open-telemetry/community](https://github.com/open-telemetry/community/blob/main/community-members.md#specifications-and-proto) for the current list. + +_Find more about the approver role in [community repository](https://github.com/open-telemetry/community/blob/master/community-membership.md#approver)._ + +### Maintainers + +- OpenTelemetry Technical Committee ([@open-telemetry/technical-committee](https://github.com/orgs/open-telemetry/teams/technical-committee)) + - See [open-telemetry/community](https://github.com/open-telemetry/community/blob/main/community-members.md#technical-committee) for the current list. +- OpenTelemetry Semantic Conventions Maintainers ([@open-telemetry/specs-semconv-maintainers](https://github.com/orgs/open-telemetry/teams/specs-semconv-maintainers)) + for the [Semantic Convention Generator](./semantic-conventions/README.md) sub-project. + - See [open-telemetry/semantic-conventions](https://github.com/open-telemetry/semantic-conventions#contributing) for the current list. + +_Find more about the maintainer role in [community repository](https://github.com/open-telemetry/community/blob/master/community-membership.md#maintainer)._